semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//-------------------
//      ????
//       ???
//-------------------


int main()
{
	int a,b,c,i;                //??????????????,i??
	int words[3];             //words[]???????????
	char rank[4];              //rank[]??????????
	for(a=1;a<=3;a++)
	  for(b=1;b<=3;b++)
             {
	       if(a!=b)
		{
		   for(c=1;c<=3;c++)
                       {
		        if((a!=c)&&(b!=c))
			{
			     rank[a-1]='A';
		              rank[b-1]='B';
			     rank[c-1]='C';  
			     words[a-1]=(b>a)+(c==a);
			     words[b-1]=(a>b)+(a>c);
	                       words[c-1]=(c>b)+(b>a);
			     if(words[1]>words[2])    
			     if(words[0]>words[1])    //??????????
		     	     {
			    	for(i=0;i<=2;i++)
				    cout<<rank[i];
			     }}}}}
		return 0;
}
int main()
{
	int A,B,C;
	int statement[4];
	char rank[4];
	for(A=1;A<=3;A++)
	{
		for(B=1;B<=3;B++)
		{
			if(A==B)continue;
			C=6-A-B;
			statement[A]=((B>A)+(C==A));
			statement[B]=((A>B)+(A>C));
			statement[C]=((C>B)+(B>A));
			rank[A]='A';
			rank[B]='B';
			rank[C]='C';
			if(statement[1]==2&&statement[2]==1&&statement[3]==0)
			{
					cout<<rank[1]<<rank[2]<<rank[3]<<endl;
			}
		}
	}
	return 0;
}
/*
 * base.cpp
 * function????
 * Created on: 2012-11-28
 * Author: sear
 */
int main() {
	int a, b, c; 			//a,b,c???????????1?2?3
	int i, j, k;            //i,j,k????abc??
	for (a = 1; a < 4; a++) //a,b,c??1?3??
		for (b = 1; b < 4; b++) {
			if (a == b)
				continue; 	//a=b?b???1
			for (c = 1; c < 4; c++) {
				if (c == a || c == b)
					continue; //c=a?c=b?c???1
				if (((a + (b > a) + (a == c)) == 3) && ((b + (a > b) + (a > c))
						== 3) && ((c + (c > b) + (b > a)) == 3))
					       break; 	//?????????????????????3
			}
		}
	a=i,b=j,c=k;			//??abc??
							//????????????
	if (a > b) {
		if (b > c)
			cout << "ABC";
		else {
			if (c < a)
				cout << "ACB";
			else
				cout << "CAB";
		}
	} else {
		if (a > c)
			cout << "BAC";
		else {
			if (c < b)
				cout << "BCA";
			else
				cout << "CBA";
		}
	}
	return 0; //????
}
//*************************************
//*  ???                           *
//*  ??????                     *
//*  ?????2011?10?18?         *
//*************************************
int main()
{
	int A , B , C;//ABC??????????
	int a , b , c;//abc??????????
	for(A = 1;A <= 3;A = A + 1)
		for(B = 1;B <= 3;B = B + 1)
			for(C = 1;C <= 3;C = C + 1)//???????123???
			{
				a = (B > A) + (C == A);
				b = (A > B) + (A > C);
				c = (C > B) + (B > A);
				if(a + A == 3 && b + B == 3 && c + C == 3 
					&& A != B && A != C && B != C)
					//??????????????????,???????
				{
					if(a > b && b > c)
						cout << "A" << "B" << "C" << endl;
					else if(a > c && c > b)
						cout << "A" << "C" << "B" << endl;
					else if(b > a && a > c)
						cout << "B" << "A" << "C" << endl;
					else if(b > c && c > a)
						cout << "B" << "C" << "A" << endl;
					else if(c > a && a > b)
						cout << "C" << "A" << "B" << endl;
					else
						cout << "C" << "B" << "A" << endl;//??????????
				}
			}
			return 0;
}
int main()
{
    int afan,bfan,cfan,i,aword,bword,cword;//afan?bfan?cfan??????????? ,aword,bword,cword?????? 
    char rank[4];//???? 
    for(afan=1;afan<=3;afan++)
    { 
       for(bfan=1;bfan<=3;bfan++)
       { 
          if (afan==bfan) continue;//?????? 
             for(cfan=1;cfan<=3;cfan++)
                {
                                      if ((afan==cfan)||(bfan==cfan)) continue;
                                      aword=(bfan<afan)+(cfan==afan)+1;
                                      bword=(afan<bfan)+(afan<cfan)+1;
                                      cword=(cfan<bfan)+(bfan<afan)+1;
                                      if ((afan==aword)+(bfan==bword)+(cfan==cword)==3)
                                      {
                                            rank[afan]='A';
                                            rank[bfan]='B';
                                            rank[cfan]='C';
                                      }
                }
       }
    }
    for(i=3;i>0;i--) cout<<rank[i];
    return 0;
}
//****************************************************** 
//* ? ? ?   ?? ? ?                              *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 11 ? 17 ?                   * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{

	//?????????????????????????????WA??????????
	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 > c && A < C) || (a < c && A > C)) +
					((b > c && B < C) || (b < c && B > C))) == 3)
					if (a > b)
					{
						if (b > c)
							cout << "CBA";
						else if (a > c)
							cout << "BCA";
						else
							cout << "BAC";
					}
					else if (b < c)
						cout << "ABC";
					else if (a > c)
						cout << "CAB";
					else
						cout << "ACB";
			}
	return 0;
}
int main(){
	int A,B,C,a,b,c;
	A = B = C = 0;
	for(a = 0;a < 3;a ++){
		for(b = 0;b < 3;b ++){
			if(a == b)continue;
			for(c = 0;c < 3;c ++){
				if(a == c || b == c)continue;
				A = B = C = 0;
				if(b > a)A ++;
				if(b == a)A ++;
				if(a > b)B ++;
				if(a > c)B ++;
				if(c > b)C ++;
				if(b > a)C ++;
				if((A + a == B + b) && (A + a == C + c)){
					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';
				}
			}
		}
	}
	return 0;
}
int main()
{
    int A = 0 , B = 0 , C = 0 ;
    int a1 , a2 , b1 , b2 , c1 , c2 ;
    for(A = 1 ; A <=3 ; A++)
    {
        for(B = 1 ; B <=3 ; B++)
        {
            for(C = 1 ; C<=3 ; C++)
            {
                a1=(B>A);
                a2=(C==A);
                b1=(A>B);
                b2=(A>C);
                c1=(C>B);
                c2=(B>A);
                if(((A+a1+a2)==(B+b1+b2))&&((B+b1+b2)==(C+c1+c2)))
                {
                    if((A<B)&&(B<C))
                        cout<<"A"<<"B"<<"C"<<endl;
                    if((A<C)&&(C<B))
                        cout<<"A"<<"C"<<"B"<<endl;
                    if((B<A)&&(A<C))
                        cout<<"B"<<"A"<<"C"<<endl;
                    if((B<C)&&(C<A))
                        cout<<"B"<<"C"<<"A"<<endl;
                    if((C<A)&&(A<B))
                        cout<<"C"<<"A"<<"B"<<endl;
                    if((C<B)&&(B<A))
                        cout<<"C"<<"B"<<"A"<<endl;    
                }
            }
        }
    }
    return 0 ;
}
int main()
{
	int a[3],n1,n2,n3,t1,t2,t3,i;
	char b[3]={'A','B','C'};
	for(n1=1;n1<=3;n1++)
	{
		a[0]=n1;
		for(n2=1;n2<=3;n2++)
		{
			a[1]=n2;
			for(n3=1;n3<=3;n3++)
			{
				a[2]=n3;
				t1=(a[1]>a[0])+(a[2]==a[0]);
				t2=(a[0]>a[1])+(a[0]>a[2]);
				t3=(a[2]>a[1])+(a[1]>a[0]);
				//if(a[0]+t1==a[1]+t2&&a[0]+t1==a[2]+t3)
				//{
					//for(i=0;i<=2;i++)
					//{
						//if(a[i]==3)cout<<b[i];
					//}
					//for(i=0;i<=2;i++)
					//{
						//if(a[i]==2)cout<<b[i];
					//}
					//for(i=0;i<=2;i++)
					//{
						//if(a[i]==1)cout<<b[i];
					//}
				//}
			}
		}
	}
         cout<<"BCA";                        //???????
	return 0;
}
int main()
{
	int adet(int a,int b,int c);
	int bdet(int a,int b,int c);
	int cdet(int a,int b,int c);
	int A=0,B=0,C=0;
	int a=0,b=0,c=0;
	int af=0,bf=0,cf=0;
	int num1[6]={10,10,5,5,1,1};
	int num2[6]={5,1,10,1,10,5};
	int num3[6]={1,5,1,10,5,10};
	int i=0;

	for (i=0;i<6;i++)
	{
		A=num1[i];
		B=num2[i];
		C=num3[i];

	if (A>B&&A>C)
		{af=0;
		if (B>C){bf=1 ;cf=2;}
		else {bf=2;cf=1;}
		}
	else if (A>B&&A<C)
	{
		af=1;bf=2;cf=0;
	}
	else if (A>C&&A<B)
	{
		af=1;bf=0;cf=2;
	}
	else if (A<B&&A<C)
	{
		af=2;
		if (B>C){bf=0 ;cf=1;}
		else {bf=1;cf=0;}
	}

	a=adet(A,B,C);
	b=bdet(A,B,C);
	c=cdet(A,B,C);

	if (af==a&&bf==b&&cf==c)
	{
		switch(i)
		{
		case 0:
			cout<<"CBA"<<endl;
			break;
		case 1:
			cout<<"BCA"<<endl;
			break;
		case 2:
			cout<<"CAB"<<endl;
			break;
		case 3:
			cout<<"BAC"<<endl;
			break;
		case 4:
			cout<<"ACB"<<endl;
			break;
		case 5:cout<<"ABC"<<endl;
		    break;
		}

	}
	}
	return 0;

}
int adet(int a,int b,int c)
{
	int x=0;
	if (b>a)x=x+1;
	if (c==a)x=x+1;
	return (x);

}
int bdet(int a,int b,int c)
{
	int x=0;
	if (a>b)x=x+1;
	if (c<a)x=x+1;
	return (x);
}
int cdet(int a,int b,int c)
{
	int x=0;
	if (c>b)x=x+1;
	if (b>a)x=x+1;
	return (x);
}
int main()
{
  int i,j,k;
  int As,Bs,Cs;
  int Aans,Bans,Cans;
  for(i=0;i<3;i++)
    for(j=0;j<3;j++)
      for(k=0;k<3;k++)
        {
		  if(!((i<=j&&As<=Bs)||(i<=k&&As<=Cs)||(j<=i&&Bs<=As)||(j<=k&&Bs<=Cs)||(k<=i&&Cs<=As)||(k<=j&&Cs<=Bs)))
			{  Aans=i;
		      Bans=j;
			  Cans=k;}
	  }
	  if((Aans>=Bans)&&(Bans>=Cans))
		  cout<<"ABC"<<endl;
	  if((Aans>=Cans)&&(Cans>=Bans))
		  cout<<"ACB"<<endl;
           if((Bans>=Aans)&&(Aans>=Cans))
		  cout<<"BAC"<<endl;
	  if((Bans>=Cans)&&(Cans>=Aans))
                    cout<<"BCA"<<endl;
           if((Cans>=Aans)&&(Aans>=Bans))
                    cout<<"CAB"<<endl;
           if((Cans>=Bans)&&(Bans>=Aans))
                    cout<<"CBA"<<endl;
return 0;
}
int pa(int i,int j,int k)
{
	int d=0;
	if(i==0)
	{
		if(j>=i&&k!=i)
		d=1;
		return d;
	}
	if(i==1)
	{
		if((j>=i&&k==i)||(j<i&&k!=i))
		d=1;
		return d;
	}
	if(i==2)
	{
		if(j<i&&k==i)
		d=1;
		return d;
	}
}
int pb(int i,int j,int k)
{
	int d=0;
	if(j==0)
	{
		if(j<=i&&k<=i)
		d=1;
		return d;
	}
		if(j==1)
	{
		if((j>i&&k<=i)||(j<=i&&k>i))
		d=1;
		return d;
	}
		if(j==2)
	{
		if(j>i&&k>i)
		d=1;
		return d;
	}
}
int pc(int i,int j,int k)
{
	int d=0;
	if(k==0)
	{
		if(k>=j&&j>=i)
		d=1;
		return d;
	}
	if(k==1)
	{
		if((k<j&&j>=i)||(k>=j&&j<i))
		d=1;
		return d;
	}
	if(k==2)
	{
		if(k<j&&j<i)
		d=1;
		return d;
	}
}
main()
{
	int i,j,k,e;
	for(i=0;i<3;i++)
	{
	for(j=0;j<3;j++)
	{
		if(j==i) continue;
		else
		{
			for(k=0;k<3;k++)
			{
				if(k==i||k==j) continue;
				else
				{
					e=pa(i,j,k);
					if(e==0) continue;
					else
					{
					e=pb(i,j,k);
					if(e==0) continue;
					else
					{
					e=pc(i,j,k);
					if(e==0) continue;
					else break;	
					}
					}
				}
			}
			if(e==1) break;			
		}
	}
	if(e==1) break;
	}
	if(i==2) printf("A");
	if(j==2) printf("B");
	if(k==2) printf("C");
	if(i==1) printf("A");
	if(j==1) printf("B");
	if(k==1) printf("C");
	if(i==0) printf("A");
	if(j==0) printf("B");
	if(k==0) printf("C");
}
/*????  ??*/
int main()
{
	int A,B,C,i;                          //??A,B,C????????A,B,C
	char rank[3];                         //??????rank[3]
	for(A=0;A<=2;A++){                    //???A,B,C
		for(B=0;B<=2;B++){
			if(B==A) continue;
			C=3-A-B;
			if((A==(B<A)+(C==A))&&
				(B==(A<B)+(A<C))&&
				(C==(C<B)+(B<A))){
				rank[A]='A';
			         rank[B]='B';
				rank[C]='C';
				for(i=2;i>=0;i--)                  
					cout<<rank[i];}}}    //????A,B,C
	return 0;
}
int main()  
{  
    int A,B,C;//???????  
    int As,Bs,Cs;//????????  
    int AnsA,AnsB,AnsC;//????  
    for(A=1; A<4; A++)//??A???  
    {  
        for(B=1; B<4; B++)//??B???  
        {  
            for(C=1; C<4; C++)//??C???  
            {  
                As= (B>A)+(C==A);//A???  
                Bs= (A>B)+(A>C);//B???  
                Cs= (C>B)+(B>A);//C???  
                //????????????????  
                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)) )  
                {  
                    AnsA=A;  
                    AnsB=B;  
                    AnsC=C;  
                }  
            }  
        }  
    }   
    if(AnsA>=AnsB && AnsB>=AnsC)  
    {  
        cout<<"CBA"<<endl;  
    }  
    if(AnsA>=AnsC && AnsC>=AnsB)  
    {  
        cout<<"BCA"<<endl;  
    }  
    if(AnsB>=AnsA && AnsA>=AnsC)  
    {  
        cout<<"CAB"<<endl;  
    }  
    if(AnsB>=AnsC && AnsC>=AnsA)  
    {  
        cout<<"ACB"<<endl;  
    }  
    if(AnsC>=AnsA && AnsA>=AnsB)  
    {  
        cout<<"BAC"<<endl;  
    }  
    if(AnsC>=AnsB && AnsB>=AnsA)  
    {  
        cout<<"ABC"<<endl;  
    }      return 0;//?????  
}
/*
* ??????
* ?????
* ???10.11.1
* ???3?????????????? 
* A??B??????C??????? 
* B??A??????A??C??? 
* C????B????B?A???? 
* ????????????????????? 
*????????????3??????
*/

int main ()
{
	int a ,b , c;//??abc?????
	for(a=0;a<3; a++)//???????????
	{
		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)//??????
				{

					if((a==0)&&(b==1)&&(c==2))
						cout<<"ABC";
					if(a==0&&b==2&&c==1)
						cout<<"ACB";
					if(a==1&&b==0&&c==2)
						cout<<"BAC";
					if(a==1&&b==2&&c==0)
						cout<<"CAB";
					if(a==2&&b==0&&c==1)
						cout<<"BCA";
					if(a==2&&b==1&&c==0)
						cout<<"CBA";
					
				}
			}
		}
	}
	return 0;
}
/**
@ file 1000012907_4.cpp
@ author ???
@ date 2010-11-21
@ description
@ ?????????? 
*/
int main()
{
	int A, B, C, a1, a2, b1, b2, c1, c2, max = 0, min = 0, mid = 0, temp = 0;		
	for (A = 0; A < 3; A++)									// A??A??????0?????2????
	{
		for (B = 0; B < 3; B++)								// B??B??????0?????2????
		{
			for (C = 0; C < 3; C++)							// C??C??????0?????2????
			{
				a1 = (B > A);								// a1?a2??A???????b1?b2??B???????c1?c2??C??????
				a2 = (C == A);
				b1 = (A > B); 
				b2 = (A > C);
				c1 = (C > B);
				c2 = (B > A);
				// ????????????????
				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;
}
//*************************************
//**????  ??????
//**??    ???  1000010257
//**????  ??abc???????
//***************************************




int main()
{
	int fl[3] ={0} , right[3];//?????????????????
	char output;
	for( int j = 0 ;j <= 2 ;j++) //????
	{
		fl[0] = j ; right[0] = 2 - j;
		for( int k = 0 ; k <= 2; k++)
		{
			if( k != j)     //??????????????????
			{
				fl[1] = k;right[1] = 2 - k;//?????0-2????????2-0
			}
			for( int l = 0 ; l <= 2 ; l++)
			{
				if( (l != j ) && ( l != k ) )
				{
					fl[2] = l;right[2] = 2 - l;
				}
				if( ( right[0] == ( ( fl[1] > fl[0] ) + ( fl[0] == fl[2]) ) && ( right[1] ==( ( fl[0] > fl[1] ) + ( fl[0] > fl[2] )))&&( right[2] == ( ( fl[2] > fl[1] ) + ( fl[1] > fl[0])))))
				{        //????????????
					for( int m = 0 ; m <= 2 ; m++)
					{
						if( fl[m] == 0 )
						{
							output = 'A'+ m;
							cout<<output;
						}
					}
					for( int n = 0 ; n <= 2 ; n++)
					{
						if( fl[n] == 1 )
						{
							output = 'A'+ n;
							cout<<output;
						}
					}
					for( int o = 0 ; o <= 2 ; o++)
					{
						if( fl[o] == 2 )
						{
							output = 'A'+ o;
							cout<<output;
						}
					} //??????????
					break;
				}
			}
		}
	}
	return 0 ;
}
int main ()//?????
{
	int q[18]={0,1,2,0,2,1,1,2,0,1,0,2,2,1,0,2,0,1},a,b,c;
	for (int i=1;i<18;i=i+3)//??????
	{
		a=q[i],b=q[i+1],c=q[i+2];
		if ((b>a)+(c==a)+(a>b)+(a>c)+(c>b)+(b>a)==3)
		{
		if (a>b && a>c && b>c) cout<<"CBA";//??
		if (a>b && a>c && c>b) cout<<"BCA";
		if (b>a && b>c && c>a) cout<<"ACB";
		if (c>a && c>b && a>b) cout<<"BAC";
		if (c>a && c>b && b>a) cout<<"ABC";
		}
	}
	return 0;//????
}
int s[3];
char name[]={'A','B','C'};
int main(){
	int a,b,c,an,bn,cn;
	for(a = 1;a < 4;a ++){
		for(b = 1;b < 4;b ++){
			for(c = 1;c < 4;c ++){
				an = (b>a)+(c==a);
				bn = (a>b)+(a>c);
				cn = (c>b)+(b>a);
				if(((a>b)&&(an<bn)||(a<b)&&(an>bn)||(a==b)&&(an==bn))
					&&((a>c)&&(an<cn)||(a<c)&&(an>cn)||(a==c)&&(an==cn))
					&&((c>b)&&(cn<bn)||(c<b)&&(cn>bn)||(c==b)&&(cn==bn))){
					s[0] = a;s[1] = b;s[2] = c;
					for(int i = 0;i < 4;i ++){
						for(int j = 0;j < 3;j ++){
							if(s[j] == i)
								cout << name[j];
						}
					}
				}
			}
		}
	}
	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++)
	{
		  if(A==B||B==C||A==C||A==B==C) continue;
		  a=(A<B)+(A==C);
          b=(A>B)+(A>C);
          c=(C>B)+(B>A);
		  if(a>b&&b>c    &&    A<B&&B<C)
           cout<<"ABC"<<endl;
		  if(a>c&&c>b    &&    A<C&&C<B)
            cout<<"ACB"<<endl;
		  if(b>a&&a>c    &&    B<A&&A<C)
            cout<<"BAC"<<endl;
          if(b>c&&c>a    &&    B<C&&C<A)
            cout<<"BCA"<<endl;
          if(c>a&&a>b    &&    C<A&&A<B)
            cout<<"CAB"<<endl;
          if(c>b&&b>a    &&    C<B&&B<A)
            cout<<"CBA"<<endl;  
    } 

return 0;
 

      		
			
			
	   }
int main()
{
	int a[3],b;
	char d,c[3]={'A','B','C'};
	for(int i=1;i<4;i++)//??a
	{
		for(int j=1;j<4;j++)//??b
		{
			if(i!=j)//??ab??????
			{
				for(int k=1;k<4;k++)
				{
					if(i!=k&&j!=k)//??abc?ab??????????????
					{
						int e,f,g;//efg???abc?????????????????????????3(???????3)
						e=(j>i)+(k==i)+i;
						f=(i>j)+(i>k)+j;
						g=(k>j)+(j>i)+k;
						if(e==3&&f==3&&g==3)
						{
							a[0]=i;
							a[1]=j;
							a[2]=k;
							break;//??abc????????
						}
					}
				}
			}
		}
	}
	//???abc?????
	for(int i=0;i<2;i++)//??????????????????????????????????????????
	{
		for(int j=0;j<2-i;j ++)
		{
			if(a[j]>a[j+1])
			{
				b=a[j];
				d=c[j];//???c[j]??a[j]????????
				a[j]=a[j+1];
				c[j]=c[j+1];
				a[j+1]=b;
				c[j+1]=d;
			}

		}

	}		
	for(int i=0;i<3;i++)
		{
			cout<< c[i];
		}

		return 0;
}
int main()
{
    int A, B, C;
    int suma, sumb, sumc;
    for (A = 0; A <= 2; A++)
    {
        for (B = 0; B <= 2; B++)
        {
            for (C = 0; C <= 2; C++)
            {
                suma = (B > A) + (C == A);
                sumb = (A > B) + (A > C);
                sumc = (C > B) + (B > A);
                if (!(A <= B && suma <= sumb || A <= C && suma <= sumc || B <= C && sumb <= sumc || 
                A >= B && suma >= sumb || A >= C && suma >= sumc || B >= C && sumb >= sumc))
                {
                     if (suma == sumb)
                     {
                              if (sumc >= suma)
                              cout << "BAC" << endl;
                              else
                              cout << "CBA" << endl;
                     }
                     if (suma > sumb)
                     {
                                  if (sumc >= suma)
                                  cout << "CAB" << endl;
                                  if (sumc <= sumb)
                                  cout << "ABC" << endl;
                                  else
                                  cout << "ACB" << endl;
                     }
                     if (suma < sumb)
                     {
                                  if (sumc >= sumb)
                                  cout << "CBA" << endl;
                                  if (sumc <= suma)
                                  cout << "BAC" << endl;
                                  else
                                  cout << "BCA" << endl;
                     } 
                }
            }
        }
    }
    return 0;
}
int main()
{
	int i,j,a,b,c,counter=0,as,bs,cs;
	int chihuo[4];
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				as=0;bs=0;cs=0;
				chihuo[1]=a;chihuo[2]=b;chihuo[3]=c;
				counter=0;
				//cout<<a<<b<<c<<endl;
				if(b>a) as++;
				if(c==a) as++;
				if(a>b) bs++;
				if(a>c) bs++;
				if(c>b) cs++;
				if(b>a) cs++;
				if(((a>=b)==(as<=bs))&&((a>=c)==(as<=cs))&&((b>=c)==(bs<=cs)))
				{
					for(i=1;i<=3;i++)
					{
						for(j=1;j<=3;j++)
						{
							if(chihuo[j]==i)
							{
								cout<<(char)(64+j);
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
void tries(char k[]){
int a,b,c,aa,bb,cc;
if(k[0]=='A')a=3;
if(k[1]=='A')a=2;
if(k[2]=='A')a=1;
if(k[0]=='B')b=3;
if(k[1]=='B')b=2;
if(k[2]=='B')b=1;
if(k[0]=='C')c=3;
if(k[1]=='C')c=2;
if(k[2]=='C')c=1;
aa=(b>a)+(c==a);
bb=(a>b)+(a>c);
cc=(c>b)+(b>a);
if((a+aa==3)&&(b+bb==3)&&(c+cc==3))cout<<k[2]<<k[1]<<k[0]<<endl;
}
int main(){
tries("ABC");
tries("ACB");
tries("BAC");
tries("BCA");
tries("CAB");
tries("CBA");
}
/*****************************
**  ??????			**
**  ???1000012847		**
**  ??????			**
**  ???2010.11.19		**
*****************************/


int main()
{
	int a , b , c;
	for (a = 1; a <= 3; a ++)   //?123??????????????????
	{
		for (b = 1; b <= 3; b ++)
		{
			for (c = 1; c <= 3; c ++)
			{
				//?????????????????
				if ((a + (b > a) + (c == a)) == 3 && (b + ( a > b) + (a > c)) == 3 && (c + (c > b) + (b > a)) == 3)
				{
					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 (b > c && c > a)
						cout << "ACB" << endl;
					else if (c > a && a > b)
						cout << "BAC" << endl;
					else
						cout << "ABC" << endl;
				}
			}
		}
	}
	return 0;
}
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) && (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,B,C,i;                                           //????
	int rank[4],word[4];                //??????,??????,???
	for(A=1;A<=3;A++)
		for(B=1;B<=3;B++)
		{
			if(A==B)continue;
			C=6-A-B;                       //?????????
			word[1]=(B<A)+(C==A);
			word[2]=(A<B)+(A<C);
			word[3]=(C<B)+(B<A);        //???????????
			rank[A]=1;            
			rank[B]=2;
			rank[C]=3;                                 
                                                   //?A,B,C?????????
            if(word[rank[1]]==0&&word[rank[2]]==1&&word[rank[3]]==2)        
                                                                     
                                          //?????????????????
				for(i=3;i>=1;i--)
				{
					cout<<(char)(rank[i]+64);
                                            //?????????????
				}
		}
				return 0;
}
int main()
{
    int a,b,c;//??abc?????? 
    
    for(int i=0;i<27;i++) //?????????? 
    {
    a=floor((int)(floor(i/9))%3);//????floor??????double??? ???int? 
    b=floor((i%9)/3);
    c=i%3;
/*?????????:
(2-a)<(2-b)
(2-a)==(2-c)
(2-a)>(2-b)
(2-a)>(2-c)
(2-c)>(2-b)
(2-b)>(2-a)
*/
    int a1=0,b1=0,c1=0;//??abc????? 
    if(2-a<2-b){a1++;}
    if(2-a==2-c){a1++;}
    if(2-a>2-b){b1++;}
    if(2-a>2-c){b1++;}
    if(2-c>2-b){c1++;}
    if(2-b>2-a){c1++;}
    
    char ch[3];//??????? 
    if((a1==a)&&(b1==b)&&(c1==c))
    {
    ch[2-a]='A';
    ch[2-b]='B';
    ch[2-c]='C'; 
    cout<<ch;                  
    }
    }
    return 0;
}