semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main ()
{
	for(int a=1;a<4;a++)
	{
		for(int b=1;b<4;b++)
		{
			for(int c=1;c<4;c++)
			{
				if(((b>a)+(c==a)==3-a)&&((a>c)+(a>b)==3-b)&&((c>b)+(b>a)==3-c))
				{
					int rank[3]={a,b,c};
					char ch[3]={'A','B','C'};
					for(int i=0;i<2;i++)
					{
						if(rank[i]<rank[i+1])
						{
							swap(rank[i],rank[i+1]);
							swap(ch[i],ch[i+1]);
						}
					}
					for(int i=2;i>=0;i--)
					{
						cout<<ch[i];
					}
				}
			}
		}
	}

	return 0;
}
int main()
{
	int a,b,c;
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
		{
			if(a==b)continue;
			else
			{
				c=3-a-b;
				if(((a+(b>a)+(c==a))==2)&&((b+(a>b)+(a>c))==2)&&((c+(c>b)+(b>a))==2))
				{
					if(a==0)cout<<'A';
					if(b==0)cout<<'B';
					if(c==0)cout<<'C';
					if(a==1)cout<<'A';
					if(b==1)cout<<'B';
					if(c==1)cout<<'C';
                    if(a==2)cout<<'A';
					if(b==2)cout<<'B';
					if(c==2)cout<<'C';
					break;
				}
			}
		}
	return 0;
}
int main() {
	int A, B, C;
	int c1, c2, c3;
	for (A = 0; A <= 2; A++)
		for (B = 0; B <= 2; B++)
			for (C = 0; C <= 2; C++)
				if (A != B && A != C && B != C) {
					c1 = (B > A) + (C == A);
					c2 = (A > B) + (A > C);
					c3 = (C > B) + (B > A);
					if (A + c1 == 2 && B + c2 == 2 && C + c3 == 2) {
						if (A > B && B > C)
							cout << "C" << "B" << "A";
						if (A > C && C > B)
							cout << "B" << "C" << "A";
						if (B > A && A > C)
							cout << "C" << "A" << "B";
						if (B > C && C > A)
							cout << "A" << "C" << "B";
						if (C > A && A > B)
							cout << "B" << "A" << "C";
						if (C > B && B > A)
							cout << "A" << "B" << "C";
					}
				}

		return 0;

}
int main (){
	int a=0,b=0,c=0;
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
			for(c=0;c<=2;c++)
			{
				if((a+(b>a)+(c==a)==2)&&
				   (b+(a>b)+(a>c)==2)&&
				   (c+(c>b)+(b>a)==2))
				{
					if((a>b)&&(a>c))              //??a=b??????
					{
						if(b>c)cout<<"CBA";       //???if??????????????a>b=c
						if(b<c)cout<<"BCA";       //????????if???
					}
					if((b>c)&&(b>a))
					{
						if(a>c)cout<<"CAB";
						if(a<c)cout<<"ACB";
					}
					if((c>a)&&(c>b))
					{
						if(a>b)cout<<"BAC";
						if(a<b)cout<<"ABC";
					}
				}
			}
}
int main()
{
	int A,B,C;                                  //???????
	int word[4];                                //??????
	char rank[4];                               //???????
	int i;                                      //??????
	for(A=1;A<=3;A++)                           //A??
	{
		for(B=1;B<=3;B++)                       //B??
		{
			if(A==B)continue;                   //??A=B
			C=6-A-B;                            //??C
		         word[A]=(B<A)+(C==A);               //A????
			word[B]=(A<B)+(A<C);                //B????
			word[C]=(C<B)+(B<A);                //C????
			if(word[1]<word[2]&&word[2]<word[3])//??????????
			{
				rank[A]='A';
				rank[B]='B';
				rank[C]='C';
		        for(i=3;i>=1;i--)               //????
			    cout<<rank[i];
			}
		}
	}
	return 0;
}
int main()
	{
		int x,y,z,a,b,c,i,j;
		for(i=0;i<=2;i++)
		{
			a=i;
			for(j=0;j<=2;j++)
			{
				if(j==i)j++;
				else 
				{
					b=j;
					c=3-a-b;
					if(b>a&&c==a)x=0;
					else if(b<=a&&c!=a)x=2;
					else x=1;
					if(a>b&&a>c)y=0;
					else if(a<=b&&a<=c)y=2;
					else y=1;
					if(c>b&&b>a)z=0;
					else if(c<=b&&b<=a)z=2;
					else z=1;
					if(x==a&&y==b&&z==c)
					{
					if(b>c&&a>c){putchar('C');if(b>a)printf("AB");else printf("BA");}
					else if(a>b&&c>b){putchar('B');if(a>c)printf("CA");else printf("AC");}
					else if(a<b&&b<c)printf("ABC");
					else printf("ACB");
					
					}
				}
			}
		}
return 0;
}
int main()
{
	int i,j,k,l;
	int a,b,c;
	char m[3];
	int t[3];
	for(i=0;i<=2;i++)
	{
		a=i;
		m[i]='A';
		for(j=0;j<=2;j++)
		{
			b=j;
			if(b==a)
			{
				continue;
			}
			m[j]='B';
			for(k=0;k<=2;k++)
			{
				c=k;
				if(c==a || c==b)
				{
					continue;
				}
				m[k]='C';
				t[0]=(b>a)+(c==a);
				t[1]=(a>b)+(a>c);
				t[2]=(c>b)+(b>a);
				if(a+t[0]==2 && b+t[1]==2 && c+t[2]==2)
				{
					for(l=0;l<3;l++)
					{
						cout<<m[l];
					}
					cout<<endl;
				}
			}
		}
	}
	return 0;
}
int main ()
{
	int a , b , c ;           //????a b c ????A B C????????? 
	int A , B , C ;           //????A B C ????A B C??????
	for ( A=0 ; A<3 ; A++)
	{
		for ( B=0 ; B<3 ; B++)
		{
			for ( C=0 ; C<3 ; C++)      //????ABC????? ???1 2 3 ????
			{
				if ( A != B && B != C && A != C)     //?A B C ???????? ?????
				{
					a = ( B > A ) + ( C == A ) ;
					b = ( A > B ) + ( A > C ) ;
					c = ( C > B ) + ( B > A ) ;
					if ( a != b && b != c && a != c)
						if ( (B>A)+(b>=a) == 1 && (A>C)+(a>=c) == 1 && (B>C)+(b>=c) == 1 )      //???????????????????
						{
							if ( A>B && B>C )  cout << "C" << "B" << "A" <<endl ;          //??????????ABC???
							else if ( A>C && C>B )  cout << "B" << "C" << "A" <<endl ;
							else if ( B>A && A>C )  cout << "C" << "A" << "B" <<endl ;
							else if ( B>C && C>A )  cout << "A" << "C" << "B" <<endl ;
							else if ( C>B && B>A )  cout << "A" << "B" << "C" <<endl ;
							else if ( C>A && A>B )  cout << "B" << "A" << "C" <<endl ;
						}
				}
			}
		}
	}
	return 0 ;
}
int main ()
{
	int a,b,i,max,min,c,as,bs,cs;
	for (a=1;a<=3;a++)
		for (b=1;b<=3;b++)
			for (c=1;c<=3;c++)
			{
			as=(b>a)+(a==c);
			bs=(a>b)+(a>c);
			cs=(c>b)+(b>a);
			if (      ( ( (a>b) && (as<bs) ) || ( (a<b) && (as>bs) ))
				    && (( (c>b) && (cs<bs) ) || ( (c<b) && (cs>bs) ) )
			     	&&( ( (a>c) && (as<cs) ) || ( (a<c) && (as>cs) )  )  )
			   cout <<"BCA";
			}
			return 0;
}
//============================================================================
// Name        : homework.cpp
// Author      : ???
// Time        : 2013.10.23
// Description : ???
//============================================================================

int main() {
	int a=0,b=0,c=0;//?????
	for(a=0;a<=2;a++){//a??
		for(b=0;b<=2;b++){//b??
			for(c=0;c<=2;c++){//c??
				if(a==b||a==c||b==c)//?????????
					continue;
				int x=0,y=0,z=0;//?????????
				if(b>a) x++;
				if(a>b) y++;
				if(a>c) y++;
				if(c>b) z++;
				if(b>a) z++;
				if(a>b&&b>c&&x<y&&y<z)//?????????
					cout<<"CBA"<<endl;
				if(a>c&&c>b&&x<z&&z<y)
					cout<<"BCA"<<endl;
				if(b>a&&a>c&&y<x&&x<z)
					cout<<"CAB"<<endl;
				if(b>c&&c>a&&y<z&&z<x)
					cout<<"ACB"<<endl;
				if(c>a&&a>b&&z<x&&x<y)
					cout<<"BAC"<<endl;
				if(c>b&&b>a&&z<y&&y<x)
					cout<<"ABC"<<endl;

			}
		}
	}
	return 0;
}//?????
int main()
{
	int A,B,C;
	char rank[3];
	int i;
	for(A=0;A<3;A++)
	{
		for(B=0;B<3;B++)
		{
			if(B!=A)
			{
				C=3-A-B;
				if((A+((B>A)+(C==A))==2)&&(B+((A>B)+(A>C))==2)&&(C+((C>B)+(B>A))==2))
				{
					rank[A]='A';
					rank[B]='B';
					rank[C]='C';
				}
			}
		}
	}
	for(i=0;i<3;i++)
		cout<<rank[i];
   	return 0;
}
//Patricia.Xiao
int main()
{
	int a,b,c,A,B,C,aw,bw,cw,Aw,Bw,Cw;  //????????????????????????
	int i,j,t;                                   //???????????
	char m[3]={'A','B','C'},p;     //????????????
	int n[3];                            //????????
	for(a=1;a<=3;a++)      //????
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				aw=((b>a)+(c==a));    //????????
				bw=((a>b)+(a>c));
				cw=((c>b)+(b>a));
				if(((a>b)&&(aw<bw))||((b>a)&&(bw<aw))||((b==a)&&(bw==aw)))
				{
					if(((c>b)&&(cw<bw))||((b>c)&&(bw<cw))||((b==c)&&(bw==cw)))
					{
						if(((a>c)&&(aw<cw))||((c>a)&&(cw<aw))||((c==a)&&(cw==aw)))
						{
							A=a;B=b;C=c; //????????
							Aw=aw;Bw=bw;Cw=cw;
                                                        break;break;break;
						}
					}
				}
			}
		}
	}
	n[0]=A;n[1]=B;n[2]=C;                //???????
	for(i=2;i>0;i--)                            //???????????
	{
		for(j=0;j<i;j++)
		{
			if(n[j]>n[j+1])
			{
				t=n[j];p=m[j];
				n[j]=n[j+1];m[j]=m[j+1];
				n[j+1]=t;m[j+1]=p;
			}
		}
	}
	printf("%c%c%c",m[0],m[1],m[2]);   //?????
	return 0;
}
int main()
{
	int A, B, C, ra, rb, rc, m, n, l;
	char p, q, r;
	for ( ra = 0; ra <= 2; ra ++)
		for ( rb = 0; rb <= 2; rb ++)
			for ( rc = 0; rc <= 2; rc ++)
			{
				A =( rb > ra )+( rc == ra);     //??A???
				B =( ra > rb )+( ra > rc);      //??B???
				C =( rc > rb )+( rb == ra);     //??C???
				if ( A + B + C == 3)
				{
					if (( A > B )&&( A > C ))
					{
						if ( B > C)
						{
							cout <<"ABC"<< endl;
						}
						else
						{
							cout <<"ACB"<< endl;
						}
					}
					else if (( B > A )&&( B > C ))
					{
						if ( A > C )
						{
							cout <<"BAC"<< endl;
						}
						else 
						{
							cout <<"BCA"<< endl;
						}
					}
					else if (( C > A )&&( C > B ))
					{
						m =C;
						if ( A > B )
						{
							cout <<"CAB"<< endl;
						}
						else
						{
							cout <<"CBA"<< endl;
						}
					}
				}
			}
			
			return 0;
}
/*
 * ????20.cpp
 * ??????
 * ????:2012-10-23
 * ??????
 */

int main(){                                                                         //???
	for(int A=0;A<=2;A++)                                                       //????A??for????A???????????0????1????2?
		for(int B=0;B<=2;B++)                                               //????B?for????B??
			for(int C=0;C<=2;C++)                                       //????C?for????C??
				if(A==(B<A)+(C==A)&&B==(A<B)+(A<C)&&C==(C<B)+(B<A)) //???????????????????????????
					for(int i=2;i>=0;i--){                      //?for?????????????????3?????
						if(A==i)
							cout<<"A";
						if(B==i)
							cout<<"B";
						if(C==i)
							cout<<"C";
					}
	return 0;                                                                   //?????
}
int main()
{int A,B,C,b[3]={0},a[3]={0};
A=0;
B=2;
C=1; 
        a[0]=(((B<A)+(C==A))==A);
        a[1]=(((A<B)+(A<C))==B);
        a[2]=(((C<B)+(C<A))==C);
        if((a[0]+a[1]+a[2])==3)
       { b[A]='A';
        b[B]='B';
        b[C]='C';
        cout<<(char)(b[2])<<(char)(b[1])<<(char)(b[0]);
	}
return 0;
}
//???:?????? 
 //??:???
 //??:2010?11?17?
 //??:?????? 
int main()

{
	int a[6][3] = { { 0 , 1 , 2 } , { 0 , 2 , 1 } , { 1 , 2  , 0 } , { 1 , 0 , 2 } , { 2 , 0 , 1 } , { 2 , 1 , 0 } } , i , A , B , C ;        // ?????????
	for ( i = 0 ; i <= 5 ; i++ )
	{
		A = ( a[i][1] > a[i][0]) + ( a[i][2] == a[i][0] ) ;
	    B = ( a[i][0] > a[i][1]) + ( a[i][0] > a[i][2] ) ;
		C = ( a[i][2] > a[i][1]) + ( a[i][1] > a[i][0] ) ;
		if ( A + a[i][0] == 2 && B + a[i][1] == 2 && C + a[i][2] == 2 )                          // ????????????????????
			break;
	}
	if ( A > B && B > C )                                                                          // ?????????
		cout << "ABC" ;
	if ( A > C && C > B )
		cout << "ACB" ;
	if ( B > A && A > C )
		cout << "BAC" ;
	if ( B > C && C > A )
		cout << "BCA" ;
	if ( C > A && A > B )
		cout << "CAB" ;
	if ( C > B && B > A )
		cout << "CBA" ;
	return 0;
}
/*
???????
??????
?????2011.10.12
*/
int main()
{
	int A,B,C,a,b,c;
	for(A = 0; A < 3; A++)
		for(B = 0; B < 3; B++)
			for(C = 0; C < 3; C++)
			{
				a = ((B > A) + (C == A));
                b = ((A > B) + (A > C));
                c = ((C > B) + (B > A));
                if(((A > B && a < b) || (A == B && a == b) || (A < B && a > b))
					+ ((A > C && a < c) || (A == C && a == c) || (A < C && a > c))
					+ ((B < C && b > c) || (B > C && b < c) || (B == C && b == c)) == 3)     //if it matches the factor,do the sentence below
				{
					if(A >= B && B >= C)
						cout << "CBA";
                    if(A >= C && C >= B)
						cout << "BCA";
					if(B >= A && A >= C)
						cout << "CAB";
					if(B >= C && C >= A)
						cout << "ACB";
					if(C >= A && A >= B)
						cout << "BAC";
					if(C >= B && B >= A)
						cout << "ABC";
				}
			}
return 0;
}
int main()
{
	int A,B,C,rightA,rightB,rightC;
	for(A=0;A<=2;A++)
		{for(B=0;B<=2;B++)
			{for(C=0;C<=2;C++)
	               {if(B>A&&A==C) rightA=2;
				   else if(B>A||A==C) rightA=1;
				   else rightA=0;
				    if(A>B&&A>C) rightB=2;
				   else if(A>B||A>C) rightB=1;
				   else rightB=0;
				    if(C>B&&B>A) rightC=2;
				   else if(C>B||B>A) rightC=1;
				   else rightC=0;

				   if(rightA>rightB&&rightB>rightC&&A<B&&B<C) cout<<"ABC"<<endl;
				   if(rightA>rightC&&rightC>rightB&&A<C&&C<B) cout<<"ACB"<<endl;
				   if(rightB>rightA&&rightA>rightC&&B<A&&A<C) cout<<"BAC"<<endl;
				   if(rightB>rightC&&rightC>rightA&&B<C&&C<A) cout<<"BCA"<<endl;
				   if(rightC>rightA&&rightA>rightB&&C<A&&A<B) cout<<"CAB"<<endl;
				   if(rightC>rightB&&rightB>rightC&&C<B&&B<A) cout<<"CBA"<<endl;
	}}}
    return 0;
}
//??????
int main()
{
	int a=0,b=0,c=0,as=0,bs=0,cs=0,i=0;//????
	char rank[10];
	for(a=0;a<3;a++)//??????
		for(b=0;b<3;b++)
			for(c=0;c<3;c++)
			{
				if((a!=b)&&(a!=c)&&(b!=c))//????????
				{					
					as=(a<b)+(a==c);//????????????
					bs=(a>b)+(a>c);
					cs=(c>b)+(b>a);				
					if((as!=bs)&&(as!=cs)&&(bs!=cs)&&(a+as==2)&&(b+bs==2)&&(c+cs==2))
					{					
						rank[as]='A';//?????????
						rank[bs]='B';
						rank[cs]='C';
						for(i=2;i>=0;i--)//??????
							cout<<rank[i];
					}
				}
			}
			cout<<endl;
	return 0;
}
int main()
{
    int a,b,c,a1,b1,c1,p=0;   //a,b,c???,a1,b1,c1?????p???,?????1 
    for (a=1;a<4;a++)
    {
        for (b=1;b<4;b++)
        {
            for (c=1;c<4;c++)
            {
                a1=(b>a)+(c==a);
                b1=(a>b)+(a>c);
                c1=(c>b)+(b>a);     //??a,b,c???? 
                if ((a1-b1)*(a-b)<0&&(a1-c1)*(a-c)<0&&(b1-c1)*(b-c)<0)
                {
                   p=1;
                   break;
                }   //????p?1????? 
            }
            if (p==1) break;
        }    //????p?1????? 
        if (p==1) break;
    }        //????p?1????? 
    if(a>b&&b>c) cout<<"CBA";
    if(a>c&&c>b) cout<<"BCA";
    if(b>a&&a>c) cout<<"CAB";
    if(b>c&&c>a) cout<<"ACB";
    if(c>a&&a>b) cout<<"BAC";
    if(c>b&&b>a) cout<<"ABC";   //??????? 
    return 0;
}
int main()
{int a,b,c,d,e,f;
  for(a=0;a<=2;a++)
  for(b=0;b<=2;b++)
  for(c=0;c<=2;c++)
   { d=(b>a)+(c==a);
     e=(a>b)+(a>c);
     f=(c>b)+(b>a);//????????? 
     if(a*b*c==0&&(a+b+c)==3&&(d+e+f)==3&&d*e*f==0)//????abcdef????????0,1,2??? 
      {if(a+d==2&&b+e==2&&c+f==2)//???????????????????? 
        {if(a>b>c)cout<<"C"<<"B"<<"A";//??a,b,c???????A,B,C 
         if(a>c>b)cout<<"B"<<"C"<<"A";
         if(b>a>c)cout<<"C"<<"A"<<"B";
         if(b>c>a)cout<<"A"<<"C"<<"B";
         if(c>a>b)cout<<"B"<<"A"<<"C";
         if(c>b>a)cout<<"A"<<"B"<<"C";
         }
       }
    }
  return 0;
}
//???????
//?  ????
//?  ??2011.10.12
int main()
{
	int A, B, C;
	int a, b, c;
	int t,k;
	char ch1, ch2, ch3;
	for (A = 1; A < 4; A++)
		for (B = 1; B < 4; B++)
			for (C = 1; C < 4; C++)
			{
				a = (B > A) + (C == A);
			    b = (A > B) + (A > C);
				c = (C > B) + (B > A);
				if ((((A > B) && (a < b)) || ((A == B) && (a == b)) || ((A < B) && (a > b))) 
                  + (((B > C) && (b < c)) || ((B == C) && (b == c)) || ((B < C) && (b > c)))
				  + (((C > A) && (c < a)) || ((C == A) && (c == a)) || ((C < A) && (c > a))) ==  3)
				{
					/*if (A <= B)
						t = A; A = B; B = t;
					if (B <= C)
						t = B; B = C; C = t;
					if (A <= C)
						t = A; A = C; C = t;*/
                   //ch1 = A + 64; ch2 = B + 64; ch3 = C + 64;
			       //cout << ch1 << ch2 << ch3 << endl;
					for(k = 1; k <= 3; k++)
					{
						if(A == k) cout << "A";
						if(B == k) cout << "B";
						if(C == k) cout << "C";
					}
                   cout << endl;
			       return 0;
				}
			}
		   

}
int main()
{
	int a[3], f[3];
	for (a[0]=0;a[0]<=2;a[0]++)
	for (a[1]=0;a[1]<=2;a[1]++)
	for (a[2]=0;a[2]<=2;a[2]++)
	{
		f[0] = (a[1] > a[0]) + (a[2] == a[0]);
		f[1] = (a[0] > a[1]) + (a[0] > a[2]);
		f[2] = (a[2] > a[1]) + (a[1] > a[0]);
		for (int i=0;i<=2;i++)
		{
			if (a[i] > a[(i+1)%3] && f[i] >= f[(i+1)%3])
			goto aa;
			if (a[i] < a[(i+1)%3] && f[i] <= f[(i+1)%3])
			goto aa;
			if (a[i] == a[(i+1)%3] && f[i] != f[(i+1)%3])
			goto aa;
		}
		for (int j=0;j<=2;j++)
		for (int i=0;i<=2;i++)
		if (a[i] < a[(i+1)%3] && a[i] < a[(i+2)%3])
		{
			cout << (char)('A'+i);
			a[i] = 3;
		}
		goto bb;
		aa:;
	}
	bb:;
	return 0;
}
int main()
{
	int a[3],t[3],i,j,k,temp;
	char c1[3],c2[3],c;
	for (a[0]=1;a[0]<=3;a[0]++)
		for (a[1]=1;a[1]<=3;a[1]++)
			for (a[2]=1;a[2]<=3;a[2]++)//????????
			{
				t[0]=(a[1]>a[0])+(a[2]==a[0]);
				t[1]=(a[0]>a[1])+(a[0]>a[2]);
				t[2]=(a[2]>a[1])+(a[1]>a[0]);//????????????
				c1[0]=c2[0]='A';c1[1]=c2[1]='B';c1[2]=c2[2]='C';//???a,b???????
				for (i=0;i<3;i++)
				{
					for (j=1;j<3;j++)
						if (a[j]>a[j-1])
					    {
							k=j-1;
   						    temp=a[i];a[i]=a[k];a[k]=temp;
						    c=c1[i];c1[i]=c1[k];c1[k]=c;
					    }
				}//????a(c1)
				for (i=0;i<3;i++)
				{
					for (j=1;j<3;j++)
						if (t[j]>t[j-1])
					    {
							k=j-1;
   						    temp=t[i];t[i]=t[k];t[k]=temp;
						    c=c2[i];c2[i]=c2[k];c2[k]=c;
					    }
				}//????b(c2)
				if ((c1[0]==c2[2])&&(c1[1]==c2[1])&&(c1[2]==c2[0]))//??????
				{
				    cout <<c1[0]<<c1[1]<<c1[2]<<endl;
					return 0;
				}
			}
	return 0;
}
//???1000012915
int main()
{
	int A,B,C;
	char F[4];
	for(A=0;A<3;A++)
	{
		for(B=0;B<3;B++)
		{
			if(A==B)continue;
			for(C=0;C<3;C++)
			{
				if(C==A || C==B)continue;
				if(A == (B<A) + (A==C) && B == (A<B) + (A<C) && C == (C<B) + (B<A))
				{
					F[A]='A';
					F[B]='B';
					F[C]='C';
					cout<<F[2]<<F[1]<<F[0];
				};
			};
		};
	};
	return 0;
}
/*
3?????????????? 
A??B??????C??????? 
B??A??????A??C??? 
C????B????B?A???? 
????????????????????? 
???????????3??????
*/


int main()
{
	int a,b,c;

	for (a=1;a<=3;a++)
		for (b=1;b<=3;b++)
		{
			c=6-a-b;
			if (a!=b) 
				if (((b>a)+(a==c)+a==3)  && ((a>b)+(a>c)+b==3) && ((c>b)+(b>a)+c==3)) 
				{
					if (a==1) cout << 'A';
					if (b==1) cout << 'B';
					if (c==1) cout << 'C';
					if (a==2) cout << 'A';
					if (b==2) cout << 'B';
					if (c==2) cout << 'C';
					if (a==3) cout << 'A';
					if (b==3) cout << 'B';
					if (c==3) cout << 'C';
					cout << endl;
				}
		}

		return 0;
}
int main()
{
	char x[3]="";                                  //???????
	int A,B,C;                                     //??????
	for (A=0;A<3;A++)
	{
		for (B=0;B<3;B++)
		{
			if (A==B)
				continue;
			C=3-A-B;                               //??????
			x[A]=(B>A)+(C==A);
			x[B]=(A>B)+(A>C);
			x[C]=(C>B)+(B>A);                      //??
			if (x[A]==2-A&&x[B]==2-B&&x[C]==2-C)
			{
				x[A]='A';
				x[B]='B';
				x[C]='C';                          //???????
				cout<<x[0]<<x[1]<<x[2]<<endl;      //??????
			}		
		}
	}
	return 0;
}
int main( )
{
    int a,b,c,i[3];                                      //?????
	char j[3]={0};
    for(a=0;a<3;a++)                                     //??for????????
	{
		for(b=0;b<3;b++)
		{
			if(b==a)continue;
			c=3-a-b;
			i[a]=(b>a)+(a==c);                //??????????
			i[b]=(a>b)+(a>c);
			i[c]=(c>b)+(b>a);
			if(i[a]+i[b]+i[c]==3&&i[a]!=i[b]&&i[b]!=i[c]&&i[a]!=i[c])//????????????3
			{
				if(i[a]+a==2&&i[b]+b==2&&i[c]+c==2)//?????? ????2
				{
			        j[a]=65;j[b]=66;j[c]=67;   //??
			        int z=0;
		         	for(z=0;z<3;z++)
				     cout<<j[z];
	}}}}
	cout<<endl;
	return 0;
}
int main() {
	int sa,sb,sc;
	for (int a=1;a<=3;a=a+1)
		for (int b=1;b<=3;b=b+1)
			for (int c=1;c<=3;c=c+1)
			{
				sa=(b>a)+(a==c);
				sb=(a>b)+(a>c);
				sc=(c>b)+(b>a);
				if (
						(a+b+c==6)&&(sa+sb+sc==3)&&(a!=b)&&(a!=c)&&(b!=c)&&(sa!=sb)&&(sa!=sc)&&(sb!=sc)&&(a+sa==3)&&(b+sb==3)&&(c+sc==3)
				   )
				{
					if (((a>b)&&(b>c))==1)
						cout <<"CBA";
					if (((a>c)&&(c>b))==1)
					    cout <<"BCA";
					if (((b>a)&&(a>c))==1)
						cout <<"CAB";
					if (((b>c)&&(c>a))==1)
						cout <<"ACB";
					if (((c>a)&&(a>b))==1)
						cout <<"BAC";
					if (((c>b)&&(b>a))==1)
					    cout <<"ABC";
				}
			}
	return 0;
	}
//***********************
//*????????     *
//*????????     *
//*??????         *
//*???11.19          *
//***********************

int main()
{
	char n[3]={'A','B','C'},t;
	int suma,sumb,sumc,q[3];
	int i ,j , k ;
	
	for(int a = 0;a < 3;a++)
		for(int b = 0;b < 3;b++)
			for(int c = 0;c < 3;c++)
			{
				suma = (b>a)+(a == c);
				sumb = (a > b)+(a > c);
				sumc = (c > b)+(b > a);
				if(a + suma == b + sumb && b + sumb == c + sumc)
				{
					q[0] = a;q[1] = b;q[2] = c;
					for(int j = 0;j < 2;j++)
					{
					for( i = j;i < 2;i++)
						if(q[i] > q[i + 1])
						{
							 k = q[i];q[i] = q[i+1];q[i + 1] = k;t = n[i];n[i] =n[i + 1];n[i + 1] = t;
						}
					}
					for(int i = 0;i < 3;i++)
					{
						cout << n[i];
					}
					cout << endl;	
				}
			}
			return 0 ;
}
//**********************************************************
//*???????                                          *
//*?  ?????                                          *
//*?  ??1000012806                                      *
//*?????2010.11.17.                                   *
//**********************************************************
int main()
{
	int a, b, c, i, j, k, A, B, C;
	for (i = 0; i <= 2; i ++)
	{
		a = i;
		for (j = 0; j <= 2; j ++)
		{
			b = j;
			if (b == a) continue;
			for (k = 0; k <= 2; k ++)
			{
				c = k;
				if (c == a || c == b) continue;
				A = (b > a) + (c == a);
				B = (a > b) + (a > c);
				C = (c > b) + (b > a);
				if ((a + A) == 2 && (b + B) == 2 && (c + C) == 2)
				{
					if (a > b && b > c)
						cout<<"C"<<"B"<<"A"<<endl;
					if (a > c && c > b)
						cout<<"B"<<"C"<<"A"<<endl;
					if (b > a && a > c)
						cout<<"C"<<"A"<<"B"<<endl;
					if (b > c && c > a)
						cout<<"A"<<"C"<<"B"<<endl;
					if (c > a && a > b)
						cout<<"B"<<"A"<<"C"<<endl;
					if (c > b && b > a)
						cout<<"A"<<"B"<<"C"<<endl;
				}
			}
		}
	}
	return 0;
}
/*
 * 220.cpp
 *
 *  Created on: 2012-11-11
 *      Author: wu
 */


int main(){
	int A,B,C,a,b,c,i;
	char pai[4];
	for(A=1;A<=3;A++){
		for(B=1;B<=3;B++){
			for(C=1;C<=3;C++){
				a=(B>A)+(C==A);
				b=(A>B)+(A>C);
				c=(C>B)+(B>A);
				if(((A+a)==(B+b))&&((A+a)==(C+c))){
					for(i=1;i<=3;i++){
						if(i==A){
							pai[i]='A';
						}
						else if(i==B){
							pai[i]='B';
						}
						else if(i==C){
							pai[i]='C';
						}

					}
					for(i=1;i<=3;i++){
						cout<<pai[i];
					}
				}
				}
			}
	}

	return 0;



}
int main()
{
	int a, b, c, n[3];
	int A[2], B[2], C[2];
	int d, e, f, i, j;
	for (a = 1; a <= 3; a++)
	{
		for (b = 1; b <= 3; b++)
		{
			if (b == a) continue;
			for (c = 1; c <= 3; c++)
			{
				if (c == a||c == b) continue;
				A[0] = b > a; A[1] = c == a; d = A[0] + A[1];
				B[0] = a > b; B[1] = a > c; e = B[0] + B[1];
				C[0] = c > b; C[1] = b > a; f = C[0] + C[1];
				if (a + d == 3&&b + e == 3&&c + f == 3)
				{
					if (a > b&&b > c) cout << 'C' << 'B' << 'A' << endl;
					if (a < b&&b < c) cout << 'A' << 'B' << 'C' << endl;
					if (a > b&&b < c&&a > c) cout << 'B' << 'C' << 'A' << endl;
					if (a > b&&b < c&&a < c) cout << 'B' << 'A' << 'C' << endl;
					if (a < b&&b > c&&a > c) cout << 'C' << 'A' << 'B' << endl;
					if (a < b&&b > c&&a < c) cout << 'A' << 'C' << 'B' <<endl;
				}
			}
		}
	}
	return 0;
}
//****************************************************** 
//* ? ? ?   ?? ? ?                              *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 11 ? 17 ?                   * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{

	//?????????????????????????????WA??????????
	int a, b, c, A, B, C; //a?b?c???????A?B?C?????????
	char m[4]; //??????
	for (a = 0; a < 3; a ++)
		for (b = 0; b < 3; b ++)
			for (c = 0; c < 3; c ++)
			{

				//????????3????????
				A = (b > a) + (c == a);
				B = (a > b) + (a > c);
				C = (c > b) + (b > a);
				if ((((a > b && A < B) || (a < b && A > B)) +
					((a > c && A < C) || (a < c && A > C)) +
					((b > c && B < C) || (b < c && B > C))) == 3) //?????????????
				{
					m[a] = 'A';
					m[b] = 'B';
					m[c] = 'C';
					m[3] = '\0';
					cout << m;
				}
			}
	return 0;
}