semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//*************************************************************
//*                  ???????                           *
//*                  ?????1000010573                     *
//*                  ?????2010?11?                     *         
//*************************************************************



int main()               //??? 
{

	int A = 0 , B = 0 , C = 0 ;//?????? 
	int a1 = 0, a2 = 0, b1 = 0, b2 = 0 , c1 = 0 , c2 = 0 ;
	//??		
	for (A = 0; A < 3; A++)// A??A?????
	{
		for (B = 0; B < 3; B++)// B??B?????
		{
			for (C = 0; C < 3; C++)// C??C?????
			{
				a1 = (B > A);// ?a1?a2????A??????
				a2 = (C == A);
				b1 = (A > B);//?b1?b2????B??????
				b2 = (A > C);
				c1 = (C > B);
				c2 = (B > A);//?c1?c2????C??????
				if (a1 + a2 + A == 2 && b1 + b2 + B == 2 && c1 + c2 + C == 2)// ????????????????
				{
				// ???????????????
					if (A < B && B < C)					
					{cout << "A" << "B" << "C";}
					if (A < C && C < B) 
					{cout << "A" << "C" << "B";}
					if (B < A && A < C)
					{cout << "B" << "A" << "C";}
					if (B < C && C < A)
					{cout << "B" << "C" << "A";}
					if (C < B && B < A)
					{cout << "C" << "B" << "A";}
					if (C < A && A < C)
					{cout << "C" << "A" << "B";}
				}
			} 
		}
	}
    return 0; 
}
/*
 * ???.cpp
 *  Created on: 2012-10-19
 *      Author: ???  1200012899
 */
int main()
{
	int a,b,c,A,B,C,CC1,CC2,CC3;
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				A=(b>a)+(a==c);//A???
				B=(a>b)+(a>c);//B???
				C=(c>b)+(b>a);//C???
				CC1=(A>B&&a<b)||(A<B&&a>b);//A?B????????????
				CC2=(A>C&&a<c)||(A<C&&a>c);//A?C????????????
				CC3=(B>C&&b<c)||(B<C&&b>c);//C?B????????????
				if(CC1&&CC2&&CC3)
				{
					//cout<<a<<b<<c;
					if(a>b&&b>c)
						cout<<"C"<<"B"<<"A"<<endl;
					else if(a>b&&a>c&&c>b)
						cout<<"B"<<"C"<<"A"<<endl;
					else if(b>a&&a>c)
						cout<<"C"<<"A"<<"B"<<endl;
					else if(b>a&&c>a&&b>c)
						cout<<"A"<<"C"<<"B"<<endl;
					else if(c>b&&b>a)
						cout<<"A"<<"B"<<"C"<<endl;
					else if(c>b&&a>b&&c>a)
						cout<<"B"<<"A"<<"C"<<endl;}//???????????????
                }
		}
    }
	return 0;
}
int main()
{
	int i,j,k,m,n,b[3];
	for(i=0;i<3;i++)
		for(j=0;j<3;j++)
		{
			if(i!=j)
				for(k=0;k<3;k++)
				{
					if(k!=i&&k!=j)
					{
						b[0]=(j>i)+(i==k);
						b[1]=(i>j)+(i>k);
						b[2]=(k>j)+(j>i);
						if(b[0]==2-i&&b[1]==2-j&&b[2]==2-k)
						{
							if(i==0)
							{
								if(j==1)cout<<"ABC";
								else cout<<"ACB";
							}
							if(j==0)
							{
								if(i==1)cout<<"BAC";
								else cout<<"BCA";
							}
							if(k==0)
							{
								if(i==1)cout<<"CAB";
								else cout<<"CBA";
							}
						}
					}
				}
		}
		return 0;
}
int main()
{
	int A,B,C,i;
	char a[4];
	for(A=1;A<=3;A++)
	{	
		for(B=1;B<=3;B++)
		{
			for(C=1;C<=3;C++)
			{
				if(   (B>A)+(C==A)==3-A  &&  (A>B)+(A>C)==3-B  &&  (C>B)+(B>A)==3-C)
				{
					a[A]='A';
					a[B]='B';
					a[C]='C';
					for(i=1;i<=3;i++)
					{
						cout<<a[i];
					}
				}
			}

		}
	}
	return 0;
}
int main()
{
	int a1,a2,b1,b2,c1,c2;
 int A,B,C;
 int d1,d2,d3;

 for(A=0;A<3;++A)
  for(B=0;B<3;++B)
   for(C=0;C<3;++C)
   {
    if((A!=B)&&(B!=C)&&(A!=C))
    {
     a1=(B>A);a2=(C==A);
     b1=(A>B);b2=(A>C);
     c1=(C>B);c2=(B>A);

     d1=a1+a2;
     d2=b1+b2;
     d3=c1+c2;
     if((d1!=d2)&&(d2!=d3)&&(d1!=d3))
     {
      if((d1==1)&&(d2!=B)&&(d3!=C))
      {
       if(d2>d3)
       {
        cout<<"BAC"<<endl;
       }
       else
       {
        cout<<"CAB"<<endl;
       }
      }
      if((d2==1)&&(d1!=A)&&(d3!=C))
      {
       if(d1>d3)
       {
        cout<<"ABC"<<endl;
       }
       else
       {
        cout<<"CBA"<<endl;
       }
      }
      if((d3==1)&&(d1!=A)&&(d2!=B))
      {
       if(d2>d1)
       {
        cout<<"BCA"<<endl;
       }
       else
       {
        cout<<"ACB"<<endl;
       }
      }
     }
    }
   }
return 0;
}
/*???3??????????????
 * A??B??????C???????;B??A??????A??C???;C????B????B?A????
 * ????????????????????????????????3??????
 *????: 2012-10-17
 *??: ??
 */

int main()
{
	char rank[3];  //??????
	for(int A = 0; A < 3; A++)    //?????????0?1?2?????????????
		for(int B = 0; B < 3; B++)
			if(A != B)
			{
				int C = 3 - A - B;  //???????
				if(((B > A) + (A == C) + A == 2) && ((A > B) + (A > C) + B == 2) && ((C > B) + (B > A) + C == 2))  //?????????
				{
					rank[A] = 'A';   //?????
					rank[B] = 'B';
					rank[C] = 'C';
					cout << rank[0] << rank[1] << rank[2];  //??????
				}
			}
	return 0;
}
//*********************************************************************
//*????food.cpp                                                   *
//*?  ??spica                                                      *
//*?????2011?11?                                               *
//*????:????????3?????                               *
//*********************************************************************
int main()
{
	int A=0,B=0,C=0;    //????????A,B,C
	int Aw=0,Bw=0,Cw=0; //???????Aw,Bw,Cw
	int As=0,Bs=0,Cs=0; // ??????As,Bs,Cs
	for(A=1;A<=3;A++)   //??A?13???????
	{
		for(B=1;B<=3;B++) //??B?13???????
		{
			for(C=1;C<=3;C++) //??C?13???????
			{
				Aw=(B>A)+(C==A); //A????
				Bw=(A>B)+(A>C);  //B????
				Cw=(C>B)+(B>A);  //C????
				if(!(A<=B&&Aw<=Bw||A<=C&&Aw<=Cw||B<=A&&Bw<=Aw||B<=C&&Bw<=Cw||C<=A&&Cw<=Aw))//??????????????????????????????????
				{
					As=A;
					Bs=B;
					Cs=C;
				}
			}
		}
	}
	if(As>=Bs&&Bs>=Cs)    //A>=B>=C
		cout<<"ABC"<<endl;
	if(As>=Cs&&Cs>=Bs)    //A>=C>=B
		cout<<"BCA"<<endl;
	if(Bs>=As&&As>=Cs)    //B>=A>=C
		cout<<"BAC"<<endl;
	if(Bs>=Cs&&Cs>=As)    //B>=C>=A
		cout<<"BCA"<<endl;
	if(Cs>=As&&As>=Bs)    //C>=A>=B
		cout<<"CAB"<<endl;
	if(Cs>=Bs&&Bs>=As)    //C>=B>=A
		cout<<"CBA"<<endl;
	return 0;
}
int main()
{
	int a=1 , b=1 ,c=1;
	while(a <= 3)
	{
		b=1;
		while(b <= 3)
		{
			c=1;
			while(c <= 3)
			{
				if((a!=b)&&(b!=c)&&(c!=a))
				{
					if((a>b)&&(b>c))            //??????a>b>c,????????a>b?????1?c??????
					{
						if((!(b>a)&&!(c==a))+((a>b)&&!(a>c))+((c>b)&&(b>a))== 3)
							cout<<"CBA";
						else if((!(b>a)&&!(c==a))+(!(a>b)&&(a>c))+((c>b)&&(b>a))== 3)
							cout<<"CBA";

					}
					else if((a>c)&&(c>b))
					{
						if((!(b>a)&&!(c==a))+((a>b)&&(a>c))+((c>b)&&!(b>a))== 3)
							cout<<"BCA";
						else if((!(b>a)&&!(c==a))+((a>b)&&(a>c))+(!(c>b)&&(b>a))== 3)
							cout<<"BCA";
					}
					else if((b>a)&&(a>c))
					{
						if(((b>a)&&!(c==a))+(!(a>b)&&!(a>c))+((c>b)&&(b>a))== 3)
				            cout<<"CAB";
						else if((!(b>a)&&(c==a))+(!(a>b)&&!(a>c))+((c>b)&&(b>a))== 3)
						    cout<<"CAB";
					}
					else if((b>c)&&(c>a))
					{
						if(((b>a)&&(c==a))+(!(a>b)&&!(a>c))+((c>b)&&!(b>a))== 3)
							cout<<"ACB";
						else if(((b>a)&&(c==a))+(!(a>b)&&!(a>c))+(!(c>b)&&(b>a))== 3)
							cout<<"ACB";
					}
					else if((c>a)&&(a>b))
					{
						if(((b>a)&&!(c==a))+((a>b)&&(a>c))+(!(c>b)&&!(b>a))== 3)
							cout<<"BAC";
						else if((!(b>a)&&(c==a))+((a>b)&&(a>c))+(!(c>b)&&!(b>a))== 3)
							cout<<"BAC";
					}
					else if((c>b)&&(b>a))
					{
						if(((b>a)&&(c==a))+((a>b)&&!(a>c))+(!(c>b)&&!(b>a))== 3)
							cout<<"ABC";
						else if(((b>a)&&(c==a))+(!(a>b)&&(a>c))+(!(c>b)&&!(b>a))== 3)
							cout<<"ABC";
					}

				}
				c=c+1;
			}
			b=b+1;
		}
		a=a+1;
	}
	return 0;
}
int main()
{
	int A, B, C, AmountA, AmountB, AmountC, jumpout = 0;
	for (AmountA = 0 ; AmountA <= 2 ; AmountA++)
	{
		for (AmountB = 0 ; AmountB <= 2 ; AmountB++)
		{
			if (AmountB == AmountA) continue;
			for (AmountC = 0 ; AmountC <= 2 ; AmountC++)
			{
				if ((AmountC == AmountB) || (AmountC == AmountA)) continue;
				A = ((AmountB > AmountB) + (AmountA == AmountC)); 
				B = ((AmountA > AmountB) + (AmountA > AmountC));
				C = ((AmountC > AmountB) + (AmountB > AmountA));
				if ((A == 2 - AmountA) && (B == 2 - AmountB) && (C == 2 - AmountC)) 
					jumpout = 1; break;
			}if (jumpout == 1) break;
		}if (jumpout == 1) break;
	} 	                                
	if (AmountA < AmountB && AmountB < AmountC) cout << "ABC";
	if (AmountB < AmountA && AmountA < AmountC) cout << "BAC";
	if (AmountC < AmountB && AmountB < AmountA) cout << "CBA";
	if (AmountB < AmountC && AmountC < AmountA) cout << "BCA";
	if (AmountA < AmountC && AmountC < AmountB) cout << "ACB";
	if (AmountC < AmountA && AmountA < AmountB) cout << "CAB";
	return 0;
}
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;
						}
					}
				}
			}
		}
	}
	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;
}
//
//  main.cpp
//  ???
//
//  Created by ???? on 13-11-3.
//  Copyright (c) 2013? ????. All rights reserved.
//

int main()
{
    int a,b,c,ca=0,cb=0,cc=0;
    for(a=1;a<=3;a++)
    {
        for(b=1;b<=3;b++)
        {
            if(b==a)continue;
            else
            {
                c=6-a-b;
                ca=(b>a)+(a==c);
                cb=(a>b)+(a>c);
                cc=(c>b)+(b>a);
                //cout<<a<<b<<c<<endl;
                //cout<<ca+a<<cb+b<<cc+c<<endl;
                
                if(ca+a==cb+b&&cb+b==cc+c)
                {
                    for(int i=1;i<=3;i++)
                    {
                        if(a==i)cout<<'A';
                        else if(b==i)cout<<'B';
                        else if(c==i)cout<<'C';
                    
                    }
                    
                }
                
            }
        }
    }
    return 0;
}
/*
 * bifanliang.cpp
 *??????
 *  Created on: 2013-9-28
 *      Author: ???
 */
int main()
{
	for(int a=0;a<=2;a++)
		for(int b=0;b<=2;b++)
		{
			int c=3-a-b;
			if((c!=a)&&(c!=b)&&(a!=b)&&((b>a)+(c==a)==2-a)&&((a>b)+(a>c)==2-b)&&((c>b)+(b>a)==2-c))
				for(int i=0;i<=2;i++)
				{
					if(a==i)
						cout<<'A';
					if(b==i)
						cout<<'B';
					if(c==i)
						cout<<'C';
				}
		}
	return 0;
}
int main()
{
	int a,b,c,s1,s2,s3;
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				s1=(b>a)+(c==a)+1;
				s2=(a>b)+(a>c)+1;
				s3=(c>b)+(b>a)+1;
				if(a+b+c==6 && a*b*c==6)
				{
					if(s1+s2+s3==6 && s1*s2*s3==6)
					{
						if(s1+a==4&&s2+b==4&&s3+c==4)
						{
						if(s1==3)cout<<"A";
						if(s2==3)cout<<"B";
						if(s3==3)cout<<"C";
						if(s1==2)cout<<"A";
						if(s2==2)cout<<"B";
						if(s3==2)cout<<"C";
						if(s1==1)cout<<"A";
						if(s2==1)cout<<"B";
						if(s3==1)cout<<"C";
						//break;
						cout<<endl;
						}
					}
				}
			}
		}
	}

	return 0;
}
int main()
{
	int A,B,C,a,b,c;
	for(int A=0;A<=2;A++)
		for(B=0;B<=2;B++)
		{
			if(B==A)
				continue;
			for(C=0;C<=2;C++)
			{
				if(C==B||C==A)
					continue;
				a=(B>A)+(C==A);
				b=(A>B)+(A>C);
				c=(C>B)+(B>A);
				if(a==2-A&&b==2-B&&c==2-C)
					for(int i=0;i<=2;i++)
					{
						if(A==i)
							cout<<"A";
						if(B==i)
							cout<<"B";
						if(C==i)
							cout<<"C";
					}
			}
			
		}
	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++)   //???ABC?0?1?2??????????
			{
				a=((B>A)+(C==A));
				b=((A>B)+(A>C));
				c=((C>B)+(B>A));
				if (A+a==B+b && B+b==C+c && C+c==A+a) //??????????
				{
					for (int i=0;i<=2;i++)
					{
						if (A==i) cout <<'A';
						if (B==i) cout <<'B';
						if (C==i) cout <<'C';  //?????
					}
				}
			}
		}
	}
	return 0;
}
int main()
{int a,b,c,p,q,r,m;
char n[3];
for(a=0;a<=2;a++)

	for(b=0;b<=2;b++)
		for(c=0;c<=2;c++)
{if(a==b||b==c||c==a)continue;
p=(b>a)+(c==a);
q=(a>b)+(a>c);
r=(c>b)+(b>a);
		if(p+a==q+b&&p+a==r+c)

		{n[a]='A';
		n[b]='B';
		n[c]='C';
		cout<<n[0]<<n[1]<<n[2];
				
}
}


}
//***************************************************
//*   ????1000012846_4.cpp  *********************
//*   ?????  ***********************************
//*   ?????2010?11?  *************************
//*   ????????  *****************************                          
//***************************************************
void judge(int A,int B,int C)         //??????ABC????????
{
	if ( A < B && B < C )
		cout << "ABC" << endl ;
	if ( A < C && C < B )
		cout << "ACB" << endl ;
	if ( B < A && A < C )
		cout << "BAC" << endl ;
	if ( B < C && C < A )
		cout << "BCA" << endl ;
	if ( C < A && A < B )
		cout << "CAB" << endl ;
	if ( C < B && B < A )
		cout << "CBA" << endl ;
}
int main()     //???
{
	int A,B,C;
	for ( A = 0 ; A < 3 ; A++ )            //?????????A,B,C
		for ( B = 0 ; B < 3 ; B++ )
			for ( C = 0 ; C < 3 ; C++ )
				if ( A + ( B > A ) + ( C == A ) == 2 && B + ( A > B ) + (A > C ) == 2 && C + ( C > B ) + ( B > A ) == 2 )
					judge(A,B,C);          //??????
	return 0;
}
//**************************************
//????1000012825_4                 *
//??????                         *
//???11.19                          *
//????????                     *
//**************************************
int main ()
{
	int a, b, c, AA1, AA2, BB1, BB2, CC1, CC2, i;
	char str[3];         //???????????A,B,C
	for ( a = 0; a <= 2; a++ )
	{
		for ( b = 0 ; b <= 2; b++ )
		{
			for ( c = 0; c <= 2; c++ )
			{
				AA1 = ( b > a );
				AA2 = ( c == a );
				BB1 = ( a > b );
				BB2 = ( a > c );
				CC1 = ( c > b );
				CC2 = ( b > a );           //???3??????
				if ((a + AA1 + AA2 == 2 ) && ( b + BB1 + BB2 == 2 ) && ( c + CC1 + CC2 == 2 ) && ( a != b) && ( a != c) && ( b != c) )
				// ?????????????????3??????
				{
					str[a] = 'A'; str[b] = 'B'; str[c] = 'C'; //????A,B,C???????
				}
			}
		}
	}
	for ( i = 0; i <= 2; i++ )//????
		cout << str[i];
	cout << endl;
	return 0;
}
int main()
{
	int a,b,c;
	int word[3];
	for (a=1;a<4;)
	{
		for (b=1;b<4;)
		{
			if (b==a)
				b=b+1;
			c=6-a-b;
			word[0]=(b>a)+(c==a);
			word[1]=(a>b)+(a>c);
			word[2]=(c>b)+(b>a);
			if ((a>b)&&(b>c)&&(word[2]>word[1])&&(word[1]>word[0]))
				cout <<"CBA"<<endl;
			if ((a>c)&&(c>b)&&(word[1]>word[2])&&(word[2]>word[0]))
				cout <<"BCA"<<endl;
			if ((b>a)&&(a>c)&&(word[2]>word[0])&&(word[0]>word[1]))
				cout <<"CAB"<<endl;
			if ((b>c)&&(c>a)&&(word[0]>word[2])&&(word[2]>word[1]))
				cout <<"ACB"<<endl;
			if ((c>a)&&(a>b)&&(word[1]>word[0])&&(word[0]>word[2]))
				cout <<"BAC"<<endl;
			if ((c>b)&&(b>a)&&(word[0]>word[1])&&(word[1]>word[2]))
				cout <<"ABC"<<endl;
			b=b+1;
		}
		a=a+1;
	}
	return 0;
}
/*
 * 14-food.cpp
 *
 *  Created on: 2012-11-9
 *      Author: joip
 */
int main ()
{
	int A,B,C; //??????????? ABC???????
	for (A=0;A<=2;A++)//????
		for (B=0;B<=2;B++)
			for (C=0;C<=2;C++)
				if( (B>A)+(C==A)==2-A && (A>B)+(A>C)==2-B && (C>B)+(B>A)==2-C )//?????????????????????ABC???
				{
					char  a[4];
					a[A]='A';  a[B]='B';  a[C]='C';
					for (int i=0;i<=2;i++)
						cout<<a[i];//???????? ??????????
				}
	return 0;
}
int main()
{
	int a,b,c;
	int ra,rb,rc;
	char result[4];
	for(a=0;a<3;a++){
		for(b=0;b<3;b++){
			for(c=0;c<3;c++){
				ra=rb=rc=0;

				ra=(b>a)+(c==a);
				rb=(a>b)+(a>c);
				rc=(c>b)+(b>a);

				if( (a>b&&ra>=rb) || (a>c&&ra>=rc) || (b>a&&rb>=ra) || (b>c&&rb>=rc) || (c>a&&rc>=ra) || (c>b&&rc>=rb) || (a==b&&ra!=rb) || (b==c&&rb!=rc) || (a==c&&ra!=rc) )//?????
					continue;
				if(a!=b&&b!=c&&a!=c){
					result[a]='A';
					result[b]='B';
					result[c]='C';
					result[3]='\0';
					cout<<result<<endl;
				}
				else if(a==b){
					if(c<a)  cout<<"CAB"<<endl;
					else     cout<<"ABC"<<endl;
			    }
				else if(b==c){
					if(a<b)  cout<<"ABC"<<endl;
					else     cout<<"BCA"<<endl;
			    }
				else if(a==c){
					if(b<a)  cout<<"BAC"<<endl;
					else     cout<<"ACB"<<endl;
			    }
			}
		}
	}
	//while(1);
	return 0;
}
/*??????
 * A??B??????C?????
 * B??A??????A??C???
 * C????B????B??A???
 * ???????????????an?????????????? */
int main(void)
{
	int F(int x,int y,int z);
	int A,B,C;
	int 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);
				int sum;
				sum=((A>B&&a<b)||(A==B&&a==b)||(A<B&&a>b))//???????????????sum=3
				       +((A>C&&a<c)||(A==C&&a==c)||(A<C&&a>c))
				       +((B<C&&b>c)||(B>C&&b<c)||(B==C&&b==c));
				//sum=((A>B)&&(a<b))((A==B)&&(a==b))((A<B)&&(a>b))
					//+((A>C)&&(a<c))((A==C)&&(a==c))((A<C)&&(a>c))
					//+((C>B)&&(c<b))((C==B)&&(c==b))((C<B)&&(c>b));
				if(sum==3)
					F(A,B,C);
			}
			return 0;
}
int F(int A ,int B ,int C)
{
	int temp;
	if(A<B) { temp=A;A=B;C=temp; }
	if(C>A)  cout<<"CAB";
	else if (C>B)  cout<<"BCA";
	else cout<<"ABC";
}
/*?? 
3?????????????? 
A??B??????C??????? 
B??A??????A??C??? 
C????B????B?A???? 
????????????????????? 
???????????3?????? 
*/
int main()
{
	int a,b,c;
	int words[4];
	int rank[4];
	
	//????????
	for (a=1;a<=3;a++)
	{
		for (b=1;b<=3;b++)
		{
			for (c=1;c<=3;c++)
			{
				if (a!=b&&b!=c&&a!=c)
				{
					words[1]=(b<a)+(c==a);
					words[2]=(a<b)+(a<c);
					words[3]=(c<b)+(b<a);
					rank[a]=1;
					rank[b]=2;
					rank[c]=3;
					if (words[rank[1]]<words[rank[2]]&&words[rank[2]]<words[rank[3]])
					{
						char c;
						for (int i=3;i>=1;i--)
						{
							c=rank[i]+64;
							cout<<c;
							//????????????
						}
					}
				}
			}
		}
	}

	return 0;
}
int main()//?????
{
	int a,b,c,word[4],rank[3],i;
	char name[3];//????
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
		{
			if(a==b)continue;
			c=3-a-b;//a,b,c???0?1?2?????
			word[1]=(b>a)+(c==a);
			word[2]=(a>b)+(a>c);
			word[3]=(c>b)+(b>a);//word[1][2][3]???a,b,c??????
			rank[a]=1;
			rank[b]=2;
			rank[c]=3;//a,b,c??????1?2?3
			if(word[rank[0]]>word[rank[1]]>word[rank[2]])
				{
					name[a]='A';
					name[b]='B';
					name[c]='C';//??a,b,c????A?B?C
					for(i=0;i<=2;i++)
						cout<<name[i];//??
			    }
		}
		return 0;
}//?????
/*
 * 2.cpp
 *
 *  Created on: 2012-10-29
 *      Author: lenovo
 */
int main()
{
    int A,B,C,t;
	char a[3]={'A','B','C'};
	int As,Bs,Cs;
	for(A=0;A<=2;A++)
		for(B=0;B<=2;B++)
			for(C=0;C<=2;C++){
	          As=((B>A)+(C==A));
	          Bs=((A>B)+(A>C));
	          Cs=((C>B)+(B>A));
	          if((A<B&&As>Bs||B<A&&Bs>As||A==B&&As==Bs)&&(C<A&&Cs>As||Cs<As&&C>A||A==C&&As==Cs)&&(B<C&&Bs>Cs||B>C&&Bs<Cs||B==C&&Bs==Cs)){
	        	  if(A<B){
	        		  t=A;
	        		  A=B;
	        		  B=t;
	        		  t=a[0];
	        		  a[0]=a[1];
	        		  a[1]=t;
	        	  }
	        	  if(A<C){
	        		  t=A;
	        		   A=C;
	        		  C=t;
	        		  t=a[0];
	        		  a[0]=a[2];
	        		 a[2]=t;
	        	  }
	        	  if(B<C){
	        		  t=B;
	        		   B=C;
	        		  	C=t;
	        		  	t=a[1];
	        		  a[1]=a[2];
	        		  a[2]=t;
	        	  }
	        	  cout<<a[2]<<a[1]<<a[0]<<endl;
	        	  }
			}

	        	return 0;
}
int main()
{
	int a1,b1,c1,s=0;
	int b[4];
	int i,j,k,l,m,n;
	for(i=1;i<=3;i++)
	{ b[1]=i;
		for(j=1;j<=3;j++)
		{
			if(!(j==i))
				b[2]=j;
			for(k=1;k<=3;k++)
			{
				if(!((k==i)||(k==j)))
				b[3]=k;
				a1=((b[2]>b[1])+(b[1]==b[3]));
				b1=((b[1]>b[3])+(b[1]>b[2]));
				c1=((b[3]>b[2])+(b[2]>b[1]));
				if((a1+b[1])==3&&(b1+b[2]==3)&&(c1+b[3])==3)
				{s=1;
					break;
				}
			}
		if(s==1)
			break;
		}
		if(s==1)
			break;
	}
	char a[4]={'Q','A','B','C'};
	for(l=1;l<=3;l++)
	{
       if(b[l]==1)
	  { cout<<a[l];
	  }
    }
	for(m=1;m<=3;m++)
	{
		 if(b[m]==2)
		 {cout<<a[m];
		 }
	}
	for(n=1;n<=3;n++)
	{
		if(b[n]==3)
		{cout<<a[n];
		}
	}
	return 0;
}
int main()//?????
{
int a,b,c,A,B,C;//??????
int say[3];//????????
for(a=0;a<=3;a++){
	for(b=0;b<=3;b++){
		for(c=0;c<=3;c++){//????????
			say[0]=(b>a)+(c==a);
			say[1]=(a>b)+(a>c);
			say[2]=(c>b)+(b>a);//???????????????
			if(!(a<=b&&say[0]<=say[1]||a<=c&&say[0]<say[2]||
				b<=a&&say[1]<=say[0]||b<=c&&say[1]<=say[2]||
				c<=a&&say[2]<=say[0]||c<=b&&say[2]<=say[1])){//??????????????????????
					A=a;
					B=b;
					C=c;
			}
		}
	}
}
if(A>=B&&B>=C){
	cout<<"CBA"<<endl;}
if(A>=C&&C>=B){
	cout<<"BCA"<<endl;}
if(B>=A&&A>=C){
	cout<<"CAB"<<endl;}
if(B>=C&&C>=A){
	cout<<"ACB"<<endl;}
if(C>=A&&A>=B){
	cout<<"BAC"<<endl;}
if(C>=B&&B>=A){
	cout<<"ABC"<<endl;}//??????????
return 0;
}
int main()
{
	int a,b,c,a1,b1,c1,p=0,i=3;   //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????? 
	for(i=1;i<4;i++)
	{
		if(a==i) cout<<"A";
		if(b==i) cout<<"B";
		if(c==i) cout<<"C";
	}
	return 0;
}
/**
 * @file ???
 * @author ???
 * @date 11-17
 * @description ??????
 */
int main()
{
    int a, b, c, sa, sb, sc, i;
    for (a = 1; a <= 3; a ++)
        for (b = 1; b <= 3; b ++)
            for (c = 1; c <= 3; c ++)
            {
                sa = 0; sb = 0; sc = 0;
                if (b > a) { sa ++; sc ++;}
                if (c == a) sa ++;
                if (a > b) sb ++;
                if (a > c) sb ++;
                if (c > b) sc ++;
                if (((a + sa) == 3) && ((b + sb) == 3) && ((c + sc) == 3))
                    for (i = 1; i <= 3; i++)
                    {
                        if (a == i) cout << 'A';
                        if (b == i) cout << 'B';
                        if (c == i) cout << 'C';
                    }
            }  
    return 0;
}
int  main()
{
	int a,b,c;
	a=0;
	while(a<3)
	{
		b=0;
		while(b<3)
		{
			c=0;
			while(c<3)
			{
				if(((((b>a)+(c==a))==(2-a))+
				(((a>b)+(a>c))==(2-b))+
			    (((c>b)+(b>a))==(2-c)))==3)
				 break;
				c++;
			}
			if(((((b>a)+(c==a))==(2-a))+
							(((a>b)+(a>c))==(2-b))+
						    (((c>b)+(b>a))==(2-c)))==3)
							 break;
			b++;
		}
		if(((((b>a)+(c==a))==(2-a))+
						(((a>b)+(a>c))==(2-b))+
					    (((c>b)+(b>a))==(2-c)))==3)
						 break;
		a++;
	}
	if(((a>=b)+(a>=c))!=2)
	{
		if(((a>=b)+(a>=c))==0)
		{
			if(b>=c)cout<<"A"<<"C"<<"B"<<endl;
			else cout<<"A"<<"B"<<"C"<<endl;
		}
		else
		{
			if(b>=c)cout<<"C"<<"A"<<"B"<<endl;
			else cout<<"B"<<"A"<<"C"<<endl;
		}
	}
	else
	{
		if(b>=c)cout<<"C"<<"B"<<"A"<<endl;
		else cout<<"B"<<"C"<<"A"<<endl;
	}
	return 0;
}
int main()
{
	int a,b,c;
	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;
				int pa=0,pb=0,pc=0;
				if(	b>a)
					pa++;
				if(a==c)
					pa++;
				if(	a>b)
					pb++;
				if(	a>c)
					pb++;
				if(	c>b)
					pc++;
				if(	b>a)
					pc++;
				if((a==2-pa)&&(b==2-pb)&&(c==2-pc))
				{
					for(int j=0;j<3;j++)
					{
						if(a==j)
							cout<<"A";
						if(b==j)
							cout<<"B";
						if(c==j)
							cout<<"C";
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
   int a,b,c;
   int x,y,z;
   a=3;
   b=2;
   c=1;
{x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   if((x<=y)&(y<=z)&&(x<=z))
   cout<<"ABC";  
   
 }
   a=3;
   b=1;
   c=2;
   {
 x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   
        
       if((x<=z)&&(z<=y)&&(x<=y))
   cout<<"ACB";    
   }
     a=2;
     b=1;
     c=3;
   {
 x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   
        
       if((x<=y)&&(z<=y)&&(z<=x))
   cout<<"CAB";    
   }
    
    a=2;
    b=3;
    c=1;
   {
 x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   
        
       if((x<=z)&&(y<=z)&&(y<=x))
   cout<<"BAC";    
   }
    a=1;
    b=2;
    c=3;
   {
 x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   
        
       if((y<x)&&(z<x)&&(z<y))
   cout<<"CBA";    
   }
    
   a=1;
   b=3;
   c=2;
   {
 x=((b>a)+(a=c));
 y=((a>b)+(a>c));
 z=((c>b)+(b>a));
   
        
       if((z<x)&&(y<x)&&(z<x))
   cout<<"BCA";    
   }
  
   return 0;
   
    }