CHCUBE:Why am I getting wrong answer?

Hey, can someone tell me why I’m getting WA.
My code:
#include"iostream"
#include"string.h"
using namespace std;
struct side
{int pos;
char col[10];
}c[6];

int main()
{
int i,j;
long int t=0;
side s;
std::cin>>t;
while(t–)
{j=1;

for(i=0;i<6;i+=2)
{c[i].pos=j;c[i+1].pos=j;j++;
 std::cin>>c[i].col;
 std::cin>>c[i+1].col;
}

for(i=0;i<6;i++)
{for(j=i+1;j<6;j++)
if(strcmp(c[j].col,c[i].col)>0)
{s=c[i];
c[i]=c[j];
c[j]=s;
}
}
int v=0;
for(i=0;i<4;i++)
{
if((strcmp(c[i].col,c[i+1].col)==0)&&(strcmp(c[i+1].col,c[i+2].col)==0)&&
(c[i].pos!=c[i+1].pos)&&(c[i+1].pos!=c[i+2].pos)&&(c[i+2].pos!=c[i].pos))
{std::cout<<"\nYES";
v=1;
}
if(v==1)
break;
}
if(v==0)
std::cout<<"\nNO";
}
return (0);
}