semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c,i;                                                      //????;a,b,c????????,i?????
	int words[3],rank[3];                                             //??????,word[3]?????????????,rank[3]?a,b,c???????????
	char person[3]={'A','B','C'};                                     //????????????'A''B''C''
	for(a=0;a<=2;a++)
	{
		for(b=0;b<=2;b++)
		{
			if(b==a)continue;
	        c=3-a-b;                                                  //????????0,1,2?????????????????????a,b,c??
			words[0]=(b>a)+(c==b);
			words[1]=(a>b)+(a>c);
			words[2]=(c>b)+(b>a);                                     //????????words[3]??
			rank[a]=0;
			rank[b]=1;
			rank[c]=2;                                                //?????????????
			if(words[rank[0]]>words[rank[1]]>words[rank[2]])          //??????????????0???????????2???????
			{
				for(i=0;i<=2;i++)
				{
					cout<<person[rank[i]];                            //??????????????????
				}
					
			}
		}
			
	}
	return 0;
}
//********************************************************
//????1.cpp
//???????????
//********************************************************

int main()
{
	int A,B,C,wa,wb,wc,i;                         //????
	char rank[3]={0};                             //??????
	for(A=0;A<=2;A++){                            //for????????
	for(B=0;B<=2;B++){
	   if(A==B) continue;
	   for(C=0;C<=2;C++){
	       if(A==C||B==C) continue;
	       wa=(B>A)+(C==A);                      //??????????
	       wb=(A>B)+(A>C);
	       wc=(C>B)+(B>A);
                  if(!(A<B&&wa<=wb||A<C&&wa<=wc||      			             B<A&&wb<=wa||B<C&&wb<=wc||
                       C<A&&wc<=wa||C<B&&wc<=wb))
                     //????????????????????????????

		{
		  rank[A]='A';
		  rank[B]='B';
		  rank[C]='C';
                         for(i=0;i<=2;i++)               //??????????
		     cout<<rank[i];
		}}}}
	return 0;
}
int main()
{
    int a,b,c,A,B,C;
    for(A=0;A<=2;A++)
      for(B=0;B<=2;B++)
        for(C=0;C<=2;C++)
        {
             a=b=c=0;
             if(B>A) a++;
             if(C==A) a++;
             if(A>B) b++;
             if(A>C) b++;
             if(C>B) c++;
             if(B>A) c++;
             if(A+a==2&&B+b==2&&C+c==2)
             {
                 if(A>B&&A>C)
                 {
                     if(B>C) printf("CBA");
                     if(C>B) printf("BCA");
                 }
                 if(B>A&&B>C)
                 {
                     if(A>C) printf("CAB");
                     if(C>A) printf("ACB");
                 }
                 if(C>B&&C>A)
                 {
                     if(B>A) printf("ABC");
                     if(A>B) printf("BAC");
                 }
             }
        }
}
int main()
{
	int a, b, c, A, B, C;
	char a1, a2, a3;
	for (a = 1; a <= 3; a++)
	{
		for (b = 1; b <= 3; b++)
		{
			for (c = 1; c <= 3; c++)
			{
				a1 = a2 = a3 = 0;
				A = (b < a) + (c == a);
				B = (a < b) + (a < c);
				C = (c < b) + (b < a);
				if ((A > B) && (A > C) && (a > b) && (a > c))
				{
					a1 = 'A';
					if ((B > C) && (b > c))
					{
						a2 = 'B';
						a3 = 'C';
					}
					else if ((C > B) && (c > b))
					{
						a2 = 'C';
						a3 = 'B';
					}
				}
				else if ((B > A) && (B > C) && (b > a) && (b > c))
				{
					a1 = 'B';
					if (A > C)
					{
						a2 = 'A';
						a3 = 'C';
					}
					else if ((C > A) && (c > a))
					{
						a2 = 'C';
						a3 = 'A';
					}
				}
				else if ((C > A) && (C > B) && (c > a) && (c > b))
				{
					a1 = 'C';
					if ((A > B) && (a > b))
					{
						a2 = 'A';
						a3 = 'B';
					}
					else if ((B > A) && (b > a))
					{
						a2 = 'B';
						a3 = 'A';
					}
				}
				if (a1 * a2 * a3 != 0)
				{
					cout << a1 << a2 << a3 << endl;
				}
			}
		}
	}
	return 0;
}
int main()//???
{  int a[3],b[3],d[3],e[3];//??????a??????,b???????????,d????a???????,e????b???????
char c[3];
c[0]='A';c[1]='B';c[2]='C';//?? c???? A B C ??
for (a[0]=0;a[0]<3;a[0]++)//???????
	for (a[1]=0;a[1]<3;a[1]++)//????
		for (a[2]=0;a[2]<3;a[2]++)//????
		{
			for (int p=0;p<3;p++)
				b[p]=0;
			if (a[1]>a[0])//??B?A???
				b[0]++;
			if (a[0]==a[2])//??A C?????
				b[0]++;
			if (a[0]>a[1])//??A???B?
				b[1]++; 
			if (a[0]>a[2])//??A???C?
				b[1]++; 
			if (a[2]>a[1])//??C?B???
				b[2]++;
			if (a[1]>a[0])//??B?A???
				b[2]++;
			for (int i=0;i<3;i++)
			{d[i]=0;
			e[i]=0;
			}
			for (int i=0;i<3;i++)
				for (int j=0;j<3;j++)            
				{
					if (a[i]>a[j])
						d[i]++;         
					if (b[i]>b[j])
						e[i]++;
				}   
				for (int j=0;j<3;j++)
				{
					if (d[0]+e[0]==2&&d[1]+e[1]==2&&d[2]+e[2]==2&&d[j]==0)
						cout<<c[j];//??????????????????c[j]
				}    
				for (int j=0;j<3;j++)
				{
					if (d[0]+e[0]==2&&d[1]+e[1]==2&&d[2]+e[2]==2&&d[j]==1)
						cout<<c[j];//??????????????????c[j]
				}    
				for (int j=0;j<3;j++)
				{
					if (d[0]+e[0]==2&&d[1]+e[1]==2&&d[2]+e[2]==2&&d[j]==2)
						cout<<c[j];//??????????????????c[j]
				} 	
		}
		return 0;
}
int main() {
	int A=0,B=0,C=0;//????A,B,C???
	int As=0,Bs=0,Cs=0;//??????????????
	int dA=0,dB=0,dC=0;//????????
	for(A=1;A<=3;A++){
		for(B=1;B<=3;B++){
			for(C=1;C<=3;C++){
				As=(B>A)+(C==A);
				Bs=(A>B)+(A>C);
				Cs=(C>B)+(B>A);
				if(!(A<=B&&As<=Bs||A<=C&&As<=Cs||
					 B<=A&&Bs<=As||B<=C&&Bs<=Cs||
					 C<=A&&Cs<=As||C<=B&&Cs<=Bs))//???????????????????????????
				{
					dA=A;
					dB=B;
					dC=C;
				}//??????????
			}
		}
	}
	if (dA>=dB&&dB>=dC)
		cout << "CBA" << endl;
	if (dA>=dC&&dC>=dB)
		cout << "BCA" << endl;
	if (dB>=dA&&dA>=dC)
		cout << "CAB" << endl;
	if (dB>=dC&&dC>=dA)
		cout << "ACB" << endl;
	if (dC>=dA&&dA>=dB)
		cout << "BAC" << endl;
	if (dC>=dB&&dB>=dA)
		cout << "ABC" << endl;//??A,B,C????????????ABC
	return 0;
}
/*
 * 36.cpp
 * ???
 *  Created on: 2012-9-27
 *      Author: Salforever
 */



int main()
{
	int suma,sumb,sumc,a,b,c,i;
	for (a=1;a<=3;a++)
		for (b=1;b<=3;b++)
			for (c=1;c<=3;c++)
				if ((a!=b)&&(a!=c)&&(b!=c))
				{
					suma=(b>=a)+(c==a);
					sumb=(a>=b)+(a>=c);
					sumc=(c>=b)+(b>=a);
					if ((suma+a==3)&&(sumb+b==3)&&(sumc+c==3))
					{
						for (i=1;i<=3;i++)
						{
							if (a==i) cout << "A";
							if (b==i) cout << "B";
							if (c==i) cout << "C";
						}
						cout << endl;
					}
				}
	return 0;
}
/*
* ???????.cpp
* ??????
* ?????2012.10.30
* ????3???????
*/
int main()
{
	int A,B,C;
	char rank[4];
	int a,b,c,i;
	for (A=1;A<=3;A++)
	{
		for (B=1;B<=3;B++)
		{
			if (A==B)continue;
			C=6-A-B;
			a=(B<A)+(C==A);
			b=(A<B)+(A<C);
			c=(C<B)+(B<A);
			if (A==(a+1)&&B==(b+1)&&C==(c+1))
			{
				rank[A]='A';
				rank[B]='B';
				rank[C]='C';
				for (i=3;i>=1;i--)
					cout<<rank[i];
			}

		}
	}
	return 0;
}
int main()
{
    char a[3]={'A','B','C'};
    int b[3],c[3];//b0,b1,b2????a,b,c???? 
    int i,j,k;//??? 
    for(i=0;i<3;i++)
    {
                    b[i]=0;
                    b[(i+1)%3]=1;
                    b[(i+2)%3]=2;
                    c[0]=(b[1]>b[0])+(b[2]==b[0]);
                    c[1]=(b[0]>b[1])+(b[0]>b[2]); 
                    c[2]=(b[2]>b[1])+(b[1]>b[0]); 
                    if( (c[i]==2)&&(c[(i+1)%3]==1)&&(c[(i+2)%3]==0))
                    cout<<a[i]<<a[(i+1)%3]<<a[(i+2)%3];
    }
    for(i=0;i<3;i++)
    {
                    b[i]=0;
                    b[(i+1)%3]=2;
                    b[(i+2)%3]=1;
                    c[0]=(b[1]>b[0])+(b[2]==b[0]);
                    c[1]=(b[0]>b[1])+(b[0]>b[2]); 
                    c[2]=(b[2]>b[1])+(b[1]>b[0]); 
                    if( (c[i]==2)&&(c[(i+1)%3]==1)&&(c[(i+2)%3]==0))
                    cout<<a[i]<<a[(i+1)%3]<<a[(i+2)%3];
    }
    return 0;
}
//****************************
//????????
//??????
//?????2010.11.18
//??????????????
//*****************************
int main ()
{
	int A1,B1,C1,a,b,c;
	int i,j,temp;
	for(A1=1;A1<=3;A1++)
		for(B1=1;B1<=3;B1++)
			for(C1=1;C1<=3;C1++)
			{
				a=(B1>A1)+(C1==A1);
				b=(A1>B1)+(A1>C1);
				c=(C1>B1)+(B1>A1);
				if(((A1>B1&&a<b)||(A1==B1&&a==b)||(A1<B1&&a>b))+((A1>C1&&a<c)||(A1==C1&&a==c)||(A1<C1&&a>c))+((B1<C1&&b>c)||(B1>C1&&b<c)||(B1==C1&&b==c))==3)
				{
					int a[3]={A1,B1,C1};
					for (i =0;i < 3;i++)
						for (j =0;j<2-i;j++)
							if (a[j] > a[j+1])
							{
								temp=a[j];
								a[j] = a[j+1];
								a[j+1] =temp;
							}
					for(i = 0;i < 3;i++) 
					{
						if(a[i] == A1) cout <<"A";
						if (a[i] ==B1) cout << "B";
						if (a[i] ==C1) cout << "C";
					}
					cout << endl;
				}
			}
	return 0;
  }
int main()
{
	int A,B,C;//????
	int a,b,c;
	char m[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-B)*(a-b)<=0 && (A-C)*(a-c)<=0 && (B-C)*(b-c)<=0)//????
					if((A==B)+(a==b)!=1 && (A==C)+(a==c)!=1 && (B==C)+(b==c)!=1)//??????
					{
						m[A]='A';//??????
						m[B]='B';
						m[C]='C';
						for(int i=1;i<=3;i++)
							cout << m[i];
					}
			}
	cout << endl;
	return 0;
}
int main(){

	int a[3][2], i, j, Person2, Person1, Person0;
//a?????????????????Personi????i???????
	
	for(a[0][0]= 0; a[0][0]<= 2; a[0][0]++){
		for(a[1][0]= 0; a[1][0]<= 2; a[1][0]++){
			for(a[2][0]= 0; a[2][0]<= 2; a[2][0]++){
//??????????0,1,2

				Person0= 0; 
				Person1= 0;
				Person2= 0;
				
				a[0][1]= (a[1][0]> a[0][0]) + (a[2][0]== a[0][0]);
				a[1][1]= (a[0][0]> a[1][0]) + (a[0][0]> a[2][0]);
				a[2][1]= (a[2][0]> a[1][0]) + (a[1][0]> a[0][0]);
//??????????


				if(!((a[0][1]== a[1][1]) || (a[0][1]== a[2][1]) || (a[1][1]== a[2][1]))){
					for(i= 0; i<= 2; i++){
						if(a[i][1]== 2)  Person2= a[i][0];
						if(a[i][1]== 1)  Person1= a[i][0];
						if(a[i][1]== 0)  Person0= a[i][0];
					}
				}
//?????????????????Person??????????

				if((Person0> Person1) && (Person1> Person2)){
					for(j= 0; j<= 2; j++){
						for(i= 0; i<= 2; i++){
							if(a[i][0]== j){
							cout<<(char)(i+ 65);
							}
//??????????????????????????
						}
					}
				}			
			}
		}
	}

	return 0;
	
}
int main()
{
	int a, b, c;
	for (a = 1; a <= 3; a++)
		for (b = 1; b <= 3; b++)
			for (c = 1; c <= 3; c++)
				if (a * b * c == 6 && a + b + c == 6)
				{
					if(((b > a) + (c == a) == (3 - a)) &&
						((a > b) + (a > c) == (3 - b)) &&
						((c > b) + (b > a) == (3 - c)))///???????????3
						if (a < b && b < c)
						{	cout << "CBA" << endl;return 0;}
						if (a < c && c < b)
							{cout << "BCA" << endl;return 0;}
						if (b < a && a < c)
							{cout << "CAB" << endl;return 0;}
						if (b < c && c < a)
							{cout << "ACB" << endl;return 0;}
						if (c < a && a < b)
							{cout << "BAC" << endl;return 0;}
						if (c < b && c < a)
							{cout << "ACB" << endl;return 0;}
				}
}
//*****************************
//* ????1000012865_4      *
//* ??????              *
//* ???2010-11-17          *
//* ??????              *
//*****************************
int main()
{
	int A, B, C, a, b, c;
	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 > B) && (b > a) || (B > A) && (a > b)) && ((A > C) && (c > a) || ( A < C) && (c < a)) && ((B > C) && (c > b) || (C > B) && (b > c)))
				{
					for(int i = 2; i >= 0; i--)
					{
						if(a == i)
							cout << 'A';
						if(b == i)
							cout << 'B';
						if(c == i)
							cout << 'C';
					}
					break;
				}
			}
	return 0;
}
int main()
{
    int a,b,c;
    for(a=1;a<=3;a++)
    for(b=1;b<=3;b++)
    for(c=1;c<=3;c++)
    {
                    if(a!=b&&b!=c)
                    {
                                  if((a+(c==a)+(b>a))==3&&(b+(a>b)+(a>c))==3&&(c+(c>b)+(b>a)==3))//??????????
                                  {
                                  if(a==3&&b==2&&c==1)//????????
                                  cout<<"CBA";
                                  else if(a==3&&b==1&&c==2)
                                  cout<<"BCA";
                                  else if(a==2&&b==3&&c==1)
                                  cout<<"CAB";
                                  else if(a==2&&b==1&&c==3)
                                  cout<<"BAC";
                                  else if(a==1&&b==3&&c==2)
                                  cout<<"ACB";
                                  else 
                                  cout<<"ABC";
                                  break;
                                  }
                    }
    }

    return 0;
}
//********************
//*??:???
//*??;???
//*2012-10-26
//********************
int main()
{
	int a, b, c, i=0;
	char  f[4]="ABC";
	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;
				if(((b<a)+(c==a)==a-1)&&((a<b)+(a<c)==b-1)&&((c<b)+(b<a)==c-1))   //????????
				{
					if(a<b&&a<c) f[0]='A';//????????
					if(b<a&&b<c) f[0]='B';
					if(c<a&&c<b) f[0]='C';
					if(f[0]=='A'){
						if(b<c)	f[1]='B',f[2]='C';   //???????
                        else f[1]='C',f[2]='B';}
					if(f[0]=='B'){
						if(a<c) f[1]='A',f[2]='C';
						else f[1]='C', f[2]='A';}
                    if(f[0]=='C'){
						if(a<b) f[1]='A',f[2]='B';
						else f[1]='B', f[2]='A';}
				}
			}
		}
	}
	for(i=2;i>=0;i--)   //??????????
		cout << f[i];
	return 0;
}
int main()
{
int a,b,c;
for(a=0;a<3;a++)
	for(b=0;b<3;b++)
		for(c=0;c<3;c++)
			if((a!=b)&&(b!=c)&&(b!=c))
				if(((b>a)+(c==a)+a==2)&&((a>b)+(a>c)+b==2)&&((c>b)+(b>a)+c==2))
					if((a>c)&&(c>b))
						cout<<"BCA";
return 0;
}
/*
 *????pro8.cpp
 *??????
 *?????2012-10-07
 *??????
 */



void work(int a,int b,int c)
{
    int x=2-a,y=2-b,z=2-c;
    char ans[3];
    ans[a]='A';ans[b]='B';ans[c]='C';
    if ((b>a)+(c==a)==x && (a>b)+(a>c)==y && (c>b)+(b>a)==z) // ????????
        cout << ans[0] << ans[1] << ans[2] << endl; // ??
}

int main()
{
    int a,b,c;
    for (a=0;a<3;a++) // ????
        for (b=0;b<3;b++)
            for (c=0;c<3;c++)
                work(a,b,c);
    return 0;
}
int main()
{
	int a, b, c;
	for (a = 1; a <= 3; a++)
		for (b = 1; b <= 3; b++)
			for (c = 1; c <= 3; c++)
				if ((c != b)&&(c != a)&&(b != a))
					if (((a < b) + (c == a) == 3 - a)
						&&((a > b) + (a > c) == 3 - b)
						&&((c > b) + (b > a) == 3 - c));
						if (a > b) 
						{
							if (b > c)
								cout << "ABC";
							else if (c > a) 
								cout << "CAB";
							else 
								cout << "ACB";
						}
						else 
						{
							if (a > c)
								cout << "BAC";
							else if (c > b)
								cout << "CBA";
							else 
								cout << "BCA";
						}
	cout << endl;

	return 0;
}
int main()
{
   int A,B,C,x,y,z;
   for(A=0;A<=2;A++)
	 for(B=0;B<=2;B++)
		for(C=0;C<=2;C++)
		{x=(A<B)+(A==C);
	     y=(A>B)+(A>C);
	     z=(C>B)+(B>A);
	     if((x>y&&y>z)&&(A<B&&B<C))
	    	cout<<"A"<<"B"<<"C"<<endl;
	     if((x>z&&z>y)&&(A<C&&C<B))
	    	cout<<"A"<<"C"<<"B"<<endl;
	     if((y>x&&x>z)&&(B<A&&A<C))
		    cout<<"B"<<"A"<<"C"<<endl;
	     if((y>z&&z>x)&&(B<C&&C<A))
	    	cout<<"B"<<"C"<<"A"<<endl;
	     if((z>x&&x>y)&&(C<A&&A<B))
	    	cout<<"C"<<"A"<<"B"<<endl;
	     if((z>y&&y>x)&&(C<B&&B<A))
	        cout<<"C"<<"B"<<"A"<<endl;
	     }
   return 0;;
}
int main()
{
int i,j,k,l;                //??for??,i,j,k????a,b,c????? 
int a,b,c;                 //??????a,b,c?????
char out[3];                      //out???? 
for(i=1;i<=3;i++)
  for(j=1;j<=3;j++)
    if(i!=j)                   //?????? 
       {
       k=6-i-j;
       a=(j>i)+(k==i);          //????a,b,c????? 
       b=(i>j)+(i>k);
       c=(k>j)+(j>i); 
       if((i>j&&j>k&&a<b&&b<c)||(i>k&&k>j&&a<c&&c<b)||(j>i&&i>k&&b<a&&a<c)||(j>k&&k>i&&b<c&&c<a)||(k>i&&i>j&&c<a&&a<b)||(k>j&&j>i&&c<b&&b<a))
       //???????? 
          {out[i]='A';             //?????? 
          out[j]='B';
          out[k]='C';
            for(l=1;l<=3;l++)      //?????? 
               cout<<out[l];                                                                                               
          }      
       } 

return 0; 
}
//* * * * * * * * * * * * * * * * * * * * * * * * 
//*???????                               *
//*???????                               *
//*?????                                   *
//*???2010.11.17                             *
//* * * * * * * * * * * * * * * * * * * * * * * * 


int main()
{
	int A, B, C, AT, BT, CT, a, b, c;	//	????A,B,C?????AT,BT,CT?????????????a,b,c???

	for (A = 1; A <= 3; A++)
	{
		for (B = 1; B <= 3; B++)
		{
			for (C = 1; C <= 3; C++)
			{
				AT = (B > A) + (A == C);
				BT = (A > B) + (A > C);
				CT = (C > B) + (B > A);	//	??????????
				if ((AT <= BT) && (A <= B) || (BT <= CT) && (B <= C) || (CT <= AT) && (C <= A) ||
					(AT >= BT) && (A >= B) || (BT >= CT) && (B >= C) || (CT >= AT) && (C >= A))	
					continue;	//	?????????????
				a = AT;
				b = BT;
				c = CT;	//	????a,b,c???
		
			}
		}
	}
	if (a <= b && b <= c)
		cout << "CBA" << endl;
	else if (a >= b && b >= c)
		cout << "ABC" << endl;
	else if (a <= b && c <= a)
		cout << "BAC" << endl;
	else if (a >= b && c >= a)
		cout << "CAB" << endl;
	else if (b >= c && c >= a)
		cout << "BCA" << endl;
	else 
		cout << "ACB" << endl;	//	????????

	return 0;
}
int main()
{
	int A,B,C;
	char rank[4];
	rank[0]=rank[1]=rank[2]=rank[3]='0';
	for(A=1;A<=3;A++)
	{
		 for(B=1;B<=3;B++)
		{ 
			for(C=1;C<=3;C++)
			{
				if(((A<B)+(A==C)==(A-1))&&((A>B)+(A>C)==(B-1))&&((C>B)+(B>A))==(C-1))
				{
				
		  
					rank[B]='B';
					rank[C]='C';
					cout<<rank[1]<<rank[2]<<"A"<<endl;
				}
			}
				
		}
	}
	return 0;
}
int main()
{
	int a=0,b=0,c=0;//??????a,b,c
	int cca=0,ccb=0,ccc=0;//????????cca,ccb,ccc
	for(a=1;a<=3;a++)
		for(b=1;b!=a,b<=3;b++)
		{
			c=6-a-b;
			cca=(b>a)+(c==a);
			ccb=(a>b)+(a>c);
			ccc=(c>b)+(b>a);
			if(((a+cca)==3)&&((b+ccb)==3)&&((ccc+c)==3))
				break;//???????????????,????
		}
		if(a>b&&b>c)
			cout<<"CBA"<<endl;
		if(a>c&&c>b)
			cout<<"BCA"<<endl;
		if(b>a&&a>c)
			cout<<"ACB"<<endl;
		if(b>c&&c>a)
			cout<<"ACB"<<endl;
		if(c>b&&b>a)
			cout<<"ABC"<<endl;
		if(c>a&&a>b)
			cout<<"BAC"<<endl;
		return 0;
}
main()
{
int  A,B,C,as,bs,cs;       //??3???,????3??
char s[3]={0};
int i;
   for (A=1;A<=3;A++)      // ??A
     for (B=1;B<=3;B++)             // ??B
        for (C=1;C<=3;C++)          // ??C
          { as=(B>A)+(C==A);
      bs=(A>B)+(A>C);
      cs=(C>B)+(B>A);
      if (!((A>=B)&&(as>=bs)||(A>=C)&&(as>=cs)
           ||(B>=C)&&(bs>=cs)||(B>=A)&&(bs>=as)
           ||(C>=A)&&(cs>=as)||(C>=B)&&(cs>=bs)))
           {  
            s[A-1] = 'A';s[C-1] = 'C';s[B-1] = 'B';

           for(i=0;i<3;i++)printf("%c",s[i]);

             }    //????
       }   //????


}
int main()
{
    int a,b,c,a0,b0,c0,x=0;                                                     //??a?b?c???A?B?C???a0?b0?c0?????????? 
    for(a=0;a<=2;a++)                                                           //????a?b?c 
    {
        for(b=0;b<=2;b++)
        {
            if(b==a)continue;                                                   //??b=a??? 
            c=3-a-b;                                                            //???????c??0?1?2????? 
            a0=(b>a)+(c==a);
            b0=(a>b)+(a>c);
            c0=(c>b)+(b>a);
            if((a==(2-a0))&&(b==2-b0)&&(c==2-c0))                               //????? 
            {
                x=1;                                                            //x??????????????x=1?????? 
                break;
            }
        }
        if(x==1)break;
    }
    char ch[3];
    ch[a]='A',ch[b]='B',ch[c]='C';                                              //??a?b?c????????????? 
    cout<<ch[0]<<ch[1]<<ch[2];
    return 0;
}
int main()
{
    int AFAN,BFAN,CFAN;//????ABC???
    int A=3,B=3,C=3;//?? ?ABC?????????,?????????????????1
    for(AFAN=2;AFAN<=3;AFAN++)//????????ABC??????????????????????????1?2?3??A?????????A??????1
       for(BFAN=1;BFAN<=3;BFAN++)
          for(CFAN=1;CFAN<=3;CFAN++)
            {
                A=B=C=3;
                if(AFAN!=BFAN&&BFAN!=CFAN&&CFAN!=AFAN)//ABC??????
                    {
                        if(BFAN>AFAN)
                           {
                               A=A-1;
                               C=C-1;//AC????????
                           }
                        else B=B-1;
                        if(AFAN>CFAN)
                           B=B-1;
                        if(CFAN>BFAN)
                           C=C-1;//???????
                     if(A>B&&B>C)  cout<<"CBA"<<endl;
                     else if(A>C&&C>B)  cout<<"BCA"<<endl;
                     else if(B>A&&A>C)  cout<<"CAB"<<endl;
                     else if(C>A&&A>B)  cout<<"BAC"<<endl;
                     else if(B>C&&C>A)  cout<<"ACB"<<endl;
                     else if(C>B&&B>A)  cout<<"ABC"<<endl;
                    }
            }
            return 0;
}
int main(){
	int a,b,c,i;
	for (a=0;a<=2;a++)
	 for (b=0;b<=2;b++)
      if (a!=b)
      { c=3-a-b;
        if ((a+(b>a)+(c==a)==2)&&(b+(a>b)+(a>c)==2)&&(c+(c>b)+(b>a)==2))
        	for (i=0;i<=2;i++)
        	   {if (a==i) cout<<'A';
        	    if (b==i) cout<<'B';
        	    if (c==i) cout<<'C';}
      }



 return 0;
}
//Patricia.Xiao
//??
int main()
{
	int a,b,c,A,B,C,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; //????????
                                                        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, k;
	int ans, bns, cns;
	k =0;
	for( A =1; A < 4; A ++ )
	{
		for( B = 1; B < 4; B ++)
		{
			for( C = 1; C < 4; C ++ )
			{
				ans = (B > A) + ( C == A);
				bns = (A > B) + ( A > C );
				cns = (C > B) + ( B > A );
					
				if((A >= B && ans >= bns) || (A >= C && ans >= cns)
					||( B >= C && bns >= cns )|| (A <= B && ans <= bns) || (A <= C && ans <= cns)||( B <= C && bns <= cns ))
					continue;
				else
				{
					k = 1;
				if( A <= B && B <= C)
					cout << "ABC" << endl;
				else if( A <= C && C <= B)
					cout << "ACB" << endl;
				else if(B <=A && A <= C)
					cout << "BAC" <<endl;
				else if(B <=C && C <= A)
					cout << "BCA" <<endl;
				else if(C <= A && A <= B)
					cout << "CAB" << endl;
				else 
					cout << "CBA" << endl;

				break;
				}
				if( k ==1 )
					break;
			}
               if( k ==1 )
					break;
		}
	             if( k ==1 )
					break;
	}			
			return 0;
}
//**********************************
//*???3.cpp                     *
//*??????                    *
//*???2011-10-02                *
//**********************************
int main()
{
    //??????abc 
    int a;
    int b;
    int c;
    int m[3];  //????,???????? ????,???? ?3 > 2 > 1 
    for(a = 1; a <= 3; a++)
    {
          for(b = 1; b <= 3; b++)
          {
                for(c = 1; c <= 3; c++)
                {
                      if((a + (b > a) + (c == a) == 3) && (b + (a > b) + (c < a) == 3) && (c + (c > b) + (a < b) == 3))
                      {
                          m[0] = a;
                          m[1] = b;
                          m[2] = c;
                      }
                }
          }
    }
    //???????????????A?B?C 
    if(m[0] > m[1] && m[1] > m[2])
    {
            cout << "CBA";
            return 0;
    }
    if(m[0] < m[1] && m[1] < m[2])
    {
            cout << "ABC";
            return 0;
    }
    if(m[0] > m[2] && m[2] > m[1])
    {
            cout << "BCA";
            return 0;
    }
    if(m[0] > m[1] && m[0] < m[2])
    {
            cout << "BAC";
            return 0;
    }
    if(m[0] < m[1] && m[1] > m[2])
    {
            cout << "CAB";
            return 0;
    }
    if(m[0] > m[1] && m[1] > m[2])
    {
            cout << "CBA";
            return 0;
    }
}