semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/**
* file homwork.cpp
* author ??? 1100012722
* data 2011-10-14
* description ???
*/ 
int main()
{
 int a,b,c;
 int n1,n2,n3;
 for(a = 1; a <= 3 ;a ++)
   for(b = 1; b <=3 ;b ++)
     if(a != b)
       {
	    c = 6 - a - b;
		n1 = (b > a) + (c == a);
		n2 = (a > b) + (a > c);
		n3 = (c > b) + (b > a);
		if( (n1 != n2 ) && (n2 != n3) &&(n1 != n3) )
		 {
		  if( a + n1==b + n2 && b + n2 == c + n3)
           {
		    if(a > b && b > c) printf("%c%c%c",'C','B','A');
            else if(a > c && c > b) printf("%c%c%c",'B','C','A');
	    	else if(b > a && a > c) printf("%c%c%c",'C','A','B');
		    else if(b > c && c > a) printf("%c%c%c",'A','C','B');
		    else if(c > a && a > b) printf("%c%c%c",'B','A','C');
	    	else if(c > b && b > a) printf("%c%c%c",'A','B','C');
		   }
		 }
		}
 return 0;
}
// 3???????.cpp : Defines the entry point for the console application.
// ???????????????
int main()
{
	int A,B,C;                             //????A?B?C????A?B?C?????1??????
	int words[4];                          //???? words[4]???A?B?C??????
	char a[4];                             //?????a[4]
	for(A=1;A<=3;A++)                      //for????
	{
		for(B=1;B<=3;B++)
		{
			if(A==B)
				continue;
			C=6-A-B;
			words[1]=(B>A)+(A==C);                           //words[1]?A????
			words[2]=(A>B)+(A>C);                            //words[2]?B????
			words[3]=(C>B)+(B>A);                            //words[3]?C????
			if(!((A>B&&words[1]<=words[2])||(A>C&&words[1]<=words[3])||(B>C&&words[2]<=words[3])||(B>A&&words[2]<=words[1])||(C>B&&words[3]<=words[2])||(C>A&&words[3]<=words[1]))==0)
				//????????????????????
				a[A]='A';
			a[B]='B';
			a[C]='C';
			if((words[1]+A==3)&&(words[2]+B==3)&&(words[3]+C==3))            //?????????????3
			for(int i=1;i<=3;i++)                                        //????for??????
				cout<<a[i];
		}
	}
	return 0;

}
int main()
{
 int A,B,C;//A,B,C??????????? 
 int a,b,c;//a,b,c??????????? 
 int i;//i????? 
 char rice[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)||(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)//???????????? 
       {
          rice[A]='A';
          rice[B]='B'; 
          rice[C]='C';                                           
       } 
     } 
   for (i=1;i<=3;i++) cout<<rice[i];
   
   return 0;             
}
int main()
{
	int a, b, c, Ca, Cb, Cc,RA, RB, RC;
	for(a=0;a<=2;a++)
	{
		for(b=0;b<=2;b++)
		{
			if(b==a) continue;
			else 
			{
				c=3-a-b;
				Ca=(b>a);
				Cb=(a>b)+(a>c);
				Cc=(c>b)+(b>a);
				if ((Ca+a==2)&&(Cb+b==2)&&(Cc+c==2))
				{RA=a;RB=b;RC=c;}
				
			}
		}
	}
	if(RA>RB&&RB>RC) cout << "CBA";
	if(RA>RC&&RA>RB) cout << "BCA";
	if(RB>RA&&RA>RC) cout << "CAB";
	if(RB>RC&&RC>RA) cout << "ACB";
	if(RC>RA&&RA>RB) cout << "BAC";
	if(RC>RB&&RB>RA) cout << "ABC";
	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&&a!=c&&b!=c)
					if((a+(b>a)+(c==a)==3)&&(b+(a>b)+(a>c)==3)&&(c+(c>b)+(b>a)==3))
						for(int 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;
	int a1, b1, c1;
	for(a = 1; a <= 3; a++)
	{
		for(b = 1; b <= 3; b++)
		{
			for(c = 1; c <= 3; c++)
			{
				a1 = ( b < a ) + ( c == a );
				b1 = ( a < b ) + ( a < c );
				c1 = ( c < b ) + ( b < a );
				//cout << a1 << " " << b1 << " " << c1 << "  " <<endl;
				if(a1<b1 && a1<c1 && b1<c1 && a<b && a<c && b<c) 
					cout << "CBA" << endl;
				else if(a1<b1 && a1<c1 && c1<b1 && a<b && a<c && c<b)  
					cout << "BCA" << endl;
				else if(b1<a1 && b1<c1 && a1<c1 && b<a && b<c && a<c)
					cout << "CAB" << endl;
				else if(b1<a1 && b1<c1 && c1<a1 && b<a && b<c && c<a) 
					cout << "ACB" << endl;
				else if(c1<a1 && c1<b1 && a1<b1 && c<a && c<b && a<b)
					cout << "BAC" << endl;
				else if(c1<a1 && c1<b1 && b1<a1 && c<a && c<b && b<a)
					cout << "ABC" << endl;
		

				
			}
		}
	}
	return 0;
}
int main()
{
	int A=0,B=0,C=0; //??????A,B,C,????????????????0?
	char rank[3]={0}; //??????rank????????
	for(A=0;A<3;A++) //?????????????????
	{
		for(B=0;B<3;B++)
		{
			if(B==A) continue;
			C=3-A-B;
			if(((B<A)+(C==A)==A)&&((A<B)+(A<C)==B)&&((C<B)+(B<A)==C)) //??????????
			{
				rank[A]='A'; rank[B]='B'; rank[C]='C'; //?????
				cout<<rank[2]<<rank[1]<<rank[0]<<endl; // ????????????
			}
		}
	}
	return 0;
}
int main()
{
	int a,b,c;              //?a,b,c????A,B,C???
	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)
					if(b + (a > b) + (a > c) == 3)
						if(c + (c > b) + (b > a) == 3)
						{
							if((a > b)&&(a > c))
							{
								if(b > c)
									cout << "CBA";
		                        if(c > b)
			                        cout << "BCA";
							}
	                        if((b > a)&&(b > c))
							{
		                        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";
							}
						}
	return 0;
}
/*
 * Homework3.15CompareAppetite.cpp
 *
 *  Created on: 2013-10-28
 *      Author: JuiceHe
 */
int main()
{
	void sort(int,int,int);
	int A,B,C,a,b,c,i;//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)+(A==C);b=(A>B)+(A>C);c=(C>B)+(B>A);
	 if((a-b)*(A-B)<0&&(c-b)*(C-B)<0&&(a-c)*(A-C)<0)//???????????
	 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,b,c,words[4]={0};//???????A,B,C,???????a,b,c?????????????words?
	char rank[4];
	for(A=1;A<4;A++)//??A?B?C????????
	{
		for(B=1;B<4;B++)
		{
			for(C=1;C<4;C++)
			{
				words[1]=(B>A)+(C==A);
				words[2]=(A>B)+(A>C);
				words[3]=(C>B)+(B>A);
				a=3-words[1];//??????????????
				b=3-words[2];
				c=3-words[3];
				if((a!=b)&&(a!=c)&&(b!=c)&&(a==A)&&(b==B)&&(c==C))//?????????????????????????????
				{rank[A]='A';
				rank[B]='B';
				rank[C]='C';
				for(int i=1;i<4;i++)//????????????????
				{cout<<rank[i];}
				}
			}
		}
	}
	return 0;
}
int main()
{
 	int A, B, C,shu[3],m;
 	char fan[] = {'A','B','C'},n;
 	int a, b, c;
 	
 	for( A = 1; A < 4; A++)
 	{
	 	 for ( B = 1; B < 4; B++)
	 	 {
		  	 for ( C = 1; C < 4; C++)
		  	 {
			  	 shu[0] = (A < B) + (A == C);
			  	 shu[1] = (B < A) + (A > C);
			  	 shu[2] = (C > B) + (B > A);

			 	 if ( ( A - B ) * ( shu[0] - shu[1] ) < 0 &&
				  	   ( A - C ) * ( shu[0] - shu[2] ) < 0 &&
					    ( B - C ) * ( shu[1] - shu[2] ) < 0  )
				  	 {
					  		  for ( int i = 0; i < 2; i++)
								 {
								  	 for (int k = 0; k < 2-i; k++)
								  	 {
									  	 if(shu[k] < shu[k+1])
									  	 {
							 		        m = shu[k];
							 		        shu[k] = shu[k+1];
							 		        shu[k+1] = m;
							 		        
							 		        n = fan[k];
							 		        fan[k] = fan[k+1];
							 		        fan[k+1] = n;
							 		   
										 }
								 	  
									  }
								 
								 }

								  cout << fan[0] << fan[1] << fan[2] << endl;
			  		 
					 }
		  
				  	   		 
		  	 }
	   
	      }
	 
	 }
	 
	 
	 return 0;
 	
}
int main()
{
        int A, B, C;
        char a[4];
        for(A=1;A<=3;A++)
           for(B=1;B<=3;B++)
           {
                   if(A==B) continue;
                   C=6-A-B;
                   if((A+(B>A)+(C==A)==3)&&(B+(A>B)+(A>C)==3)&&(C+(C>B)+(B>A)==3)==1)
                   {
                           a[A]='A';
                           a[B]='B';
                           a[C]='C';
                           cout<<a[1]<<a[2]<<a[3]<<endl;
                           goto T;
                   }
           }
        T:
        return 0;
}
int main()
{
	int A,B,C;
	int  d[6][3]={{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}};
	for (int i=4;i<6;i++)
	{
		A=d[i][0];
		B=d[i][1];
		C=d[i][2];
		if ((B>A)+(A==C)+(A>B)+(A>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 if (C>B && B>A)
				cout<<"ABC"<<endl;
		}
	}
	return 0;
}
int main()
{int a=0,b=0,c=0;int d=0,e=0,f=0;char x[4];int i=0;
for(a=1;a<=3;a++)
	for(b=1;b<=3;b++)
		if(b!=a)
			for(c=1;c<=3;c++)
				if(c!=a&&c!=b)
			{d=(b>a)+(c==a);e=(a>b)+(a>c);f=(c>b)+(b>a);
//cout<<d<<e<<f<<endl;}
                 if((a+d)==(b+e)&&(a+d)==(c+f))
					 for(i=1;i<=3;i++)
					 {if(i==a)x[i]='A';if(i==b)x[i]='B';if(i==c)x[i]='C';}}
for(i=1;i<=3;i++)cout<<x[i];
cout<<endl;
					 
                 
cin.get();cin.get();
return 0;
}
/*
 * ???.cpp
 *
 *  Created on: 2012-11-1
 *      Author: ??
 */
int main() {
	int a, b, c;
	for (a = 0; a < 3; a++) {
		for (b = 0; b < 3; b++) {
			if (b == a)
				continue;
			for (c = 0; c < 3; c++) {
				if (c == a || c == b)
					continue;//???????2??????0???
				if ((((b > a) + (c == a)) == (2 - a)) && (((a > b) + (a > c))
						== (2 - b)) && (((c > b) + (c > a)) == (2 - 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;
}
//*************************************************
//*???????                              ****
//*??????   1100013009                   ****
//*???2011.10.15                            ****
//*?????????????????          ****
//*************************************************
int main()
{
	int a, b, c;                   // ?????????????????????max1?max2?max
	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
				 if (a + (b > a) + (c == a ) == 3 && b + (a > b) + (a > c ) == 3 && c + (c > b) + (b > a ) == 3)
					                            // ???????a, b, c
				 {
					 int k, min = 10, n[3], i, j;  // ??????k, i, j, ?????min???a, b, c,????????n[3]
					 char m[3];                    // ????A, B, C???m[3]
					 m[0] = 'A';                   // ????????????
					 m[1] = 'B';
				     m[2] = 'C';
				     n[0] = a;
				     n[1] = b;
				     n[2] = c;
					 for (k = 0; k < 3; k++)      // ????
					 {
						 for (i = 0; i < 3; i++)  // ????????????????
						 {
							 if (min > n[i])
							 {
								 min = n[i];
								 j = i;           // ?j??i???????????
							 }
						 }
							 cout << (char)(m[j]);  // ????????
							 n[j] = 10;               // ????????0???????????????
							 min = 10;                 // ?????????????????????
					 }
				 }
				 return 0;
}
int main()
{
    int	A=0,B=0,C=0,a=0,b=0,c=0,d[3][3],i=0,j=0,p=0;
	char f[2][2];
	for(A=0;A<3;A++)
		{
			for(B=0;B<3;B++)
			{
				for(C=0;C<3;C++)
			   {  
				d[0][0]=A;d[0][1]=(B>A);d[0][2]=(C==A);
				d[1][0]=B;d[1][1]=(A>B);d[0][2]=(A>C);
				d[2][0]=C;d[2][1]=(C>B);d[2][2]=(B>A);
				for(i=0;i<3;i++)
				{
					if(d[i][0]==2-d[i][1]-d[i][2])
						
					p++;
					
				}
				if(p==3){
					
						if(A>B>C)
					    cout<<"ABC"<<endl;
						if(A>C>B)
							cout<<"ACB"<<endl;
						if(B>A>C)
							cout<<"BAB"<<endl;
						if(B>C>A)
							cout<<"BCA"<<endl;
						if(C>A>B)
							cout<<"CAB"<<endl;

						if(C>B>A)
							cout<<"CBA"<<endl;
				    break;}
			   }
				if(p==3)break;
			}
			if(p==3) break;
	}

			return 0;
}
/*
 * 40.cpp
 *
 *  Created on: 2012-10-20
 *      Author: zhuyongfu
 */



int main(){
	int a,b,c;//????
	for(a = 0;a <= 2;a++)//????
	{
		for(b = 0;b <= 2;b++)//????
		{
			for(c = 0;c <= 2;c++)//????
			{
				if(((b > a) + (c == a) + a == 2)&&((a > b) + (a > c) + b == 2)&&((c > b) + (b > a) + 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;
}
int main()
{
    int a[3],as[3],c,i,j;
    char b[3]={'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]++)
            {
                c=0;
                as[0]=(a[1]>a[0])+(a[2]==a[0]);
                as[1]=(a[0]>a[1])+(a[0]>a[2]);
                as[2]=(a[2]>a[1])+(a[1]>a[0]);
                if( a[0]!=a[1] && a[1]!=a[2] && a[2]!=a[0] && as[0]!=as[1] && as[1]!=as[2] && as[2]!=as[0] )
                {
                    if((a[0]+as[0]==2)&&(a[1]+as[1]==2)&&(a[2]+as[2]==2))
                    {
                        for(i=0;i<3;i++)
                            for(j=0;j<3;j++)
                                if(a[j]==i)
                                    printf("%c",b[j]);
                        //printf("%d %d %d\n",a[0],a[1],a[2]);
                    }
                }

            }
    return 0;
}
int main()                    //?????
{
	int a=0,b=0,c=0;          //??ABC??
	void check(int x,int y,int z);   //???????????
	for(a=0;a<3;a++)
	{
		for(b=0;b<3;b++)
		{
			if(a==b)
				continue;
			else
			{
				for(c=0;c<3;c++)
				{
					if(c==a||c==b)
						continue;         //?????????????
					else            
					{
						check(a,b,c);     //????
					}}}}}
	return 0;
}
void check(int x,int y,int z)             //??????
{
	int n1=0,n2=0,n3=0,i=0;
	char rank[3];
	n1=(y>x)+(z==x);
	n2=(x>y)+(x>z);
	n3=(z>y)+(y>x);                       //??????????
	if((n1==2-x)&&(n2==2-y)&&(n3==2-z)) 
	{
		rank[x]='A';
		rank[y]='B';
		rank[z]='C';                      //???????????
	for(i=0;i<3;i++)
		cout<<rank[i];               //????
	}
}
int main()
{
    int a,b,c;             //?????
    int worda,wordb,wordc; //???????
    char rank[4];          //????????????
    char final[3]={0};    //????????? 
    for(a=1;a<=3;a++)          //??????
        {
               for(b=1;b<=3;b++)
               {
                                if(b==a) continue;
                                c=(6-a-b);
                                worda=(a>b)+(a==c);     //????????
                                wordb=(a<b)+(a<c);
                                wordc=(b>c)+(b<a);
                                if(worda==(a-1)&&wordb==(b-1)&&wordc==(c-1)) //??????
                                {
                                       rank[a]='A';      //?????
                                       rank[b]='B';
                                       rank[c]='C';
                                       for(int i=1;i<=3;i++)      
                                       {
                                               final[i-1]=rank[4-i];  //??????????? 
                                       }
                                       
                                } 
               }
                                
                                
        }
        cout<<final<<endl;
        return 0;
}
//???
int main()
{
    int A=0,B=0,C=0,i=0,j=0,k=0;                                 //???? 
    char a[3]={0,0,0};                                           //???? 
    for(A=0;A<3;A++)
    {                                                           
        for(B=0;B<3;B++)
        {
            if(A==B)continue;
            for(C=0;C<3;C++)                                       //??A,B,C???            
             {
                  if(A==C||B==C)continue;
                  i=(B>A)+(A==C);
                  j=(A>B)+(A>C);
                  k=(C>B)+(B>A);
                  if(i+j+k==3&i!=j&i!=k&j!=k&i+A==2&j+B==2&k+C==2)              //???????????????????? 
                  {   
                      a[2-A]='A';                                               //????? 
                      a[2-B]='B';
                      a[2-C]='C';
                      cout<<a[2]<<a[1]<<a[0]<<endl;                     
                  }
             }
        }
    }
        return 0;
}
int MAX(int a, int b, int c)
{
	int t=0;
	if (a>b)
		t=a;
	if (c>t)
		t=c;
	return t;
}

int MIN(int a, int b, int c)
{
	int t=0;
	if (a<b)
		t=a;
	if (c<t)
		t=c;
	return t;
}

int main()
{
	int A, B, C;
	int a, b, c;
	int e, f, g;
	char first, second, third;
	for (A = 1; A <= 3; 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>C&&a<c)||(A<C&&a>c))+((B>C&&b<c)||(B<C&&b>c))==3)
				{
					e = MAX(a, b, c);
					g = MIN(a, b, c);
					f = a+b+c-e-g;
				}
			}
		}
	}
	first = 65 + e;
	second = 65 + f;
	third = 65 + g;
	cout << first << second << third << endl;
	return 0;
}
/*
 * bifanliang.cpp
 * ??:???
 * ????: 2012-10-26
 * ??????
 */
int main(){
	int A=0,B=0,C=0,a=0,b=0,c=0;//????
	for(A=1;A<=3;A++)//????????
		for(B=1;B<=3;B++)
		{
			if(A==B)continue;
			else {
				for(C=1;C<=3;C++)
				{
					if((C==B)||(C==A))continue;
					else
					{
						if(((B>A)+(C==A)==(3-A))&&((A>B)+(A>C)==(3-B))&&
								((C>B)+(B>A)==(3-C)))
						{
							a=A;b=B;c=C;//??????????????????
						}
					}
				}
			}
		}
	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((b>a)&&(a>c))cout<<"CAB";
	if((c>a)&&(a>b))cout<<"BAC";
	if((c>b)&&(b>a))cout<<"ABC";//???????????
	return 0;//????
}
/**
* @file 1000012800_1.cpp
* @author ??
* @date 2010-11-18
* @description
* ??????:????
*/


int main()
{
	char A, B, C;
	
	char rank[4];
	for (A = 1; A <= 3; A ++)
	
		for(B = 1; B <= 3; B ++)
		{
			if (A == B)
				continue;
		
			for (C = 1; C <= 3; C ++)
			{

				int a[4] = {0};
				if (A == C || B == C)
					continue;
				rank[A] = 'A';
				rank[B] = 'B';
				rank[C] = 'C';
				if(B < A)
					a[A] ++;
				if (C == A)
					a[A] ++;
				if(A < B)
					a[B] ++;
				if(A < C)
					a[B] ++;
				if(C < B)
					a[C] ++;
				if(B < A)
					a[C] ++;
				if(a[1] < a[2] && a[2] < a[3])
				{
					cout << rank[3] << rank[2] << rank[1] << endl;
				}
			}
		}
		return 0;
}
/*
 *???????
 *??????1100019007?
 *???2012-10-15
 *??????????????
 */ 
int main()
{
  char res[3];
  int af,bf,cf;
  int ah,bh,ch,i;
  for(af=0;af<3;af++)
  {
    for(bf=0;bf<3;bf++)
    {
      for(cf=0;cf<3;cf++)
      {
        ah=0;
        bh=0;
        ch=0;
        if(bf>af)ah++;
        if(cf==af)ah++;
        if(af>bf)bh++;
        if(af>cf)bh++;
        if(cf>bf)ch++;
        if(bf>af)ch++;
        if((((ah>bh)&&(af<bf))||((ah<bh)&&(af>bf)))
        &&(((bh>ch)&&(bf<cf))||((bh<ch)&&(bf>cf)))
        &&(((ch>ah)&&(cf<af))||((ch<ah)&&(cf>af))))
        {
          res[2-af]='A';
          res[2-bf]='B';
          res[2-cf]='C';
          cout<<res[2]<<res[1]<<res[0]<<endl;
          return 0;
        }
      }
    }
  }
  return 0;
}
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>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&&b>a)
				{
					cout<<"ABC"<<endl;
					return 0;
				}
			}
		}
	}
}
int main()
{
	int A,B,C,As,Bs,Cs,m,n,p;
	for(A=1;A<=3;A=A+1)
	{
		for(B=1;B<=3;B=B+1)
		{
			for(C=1;C<=3;C=C+1)
			{
				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))
				{
					m=A;
					n=B;
					p=C;
				}
			}
		}
	}
	if(m>=n&&n>=p)
	{
		cout<<"CBA"<<endl;
	}
	if(m>=p&&p>=n)
	{
		cout<<"BCA"<<endl;
	}
	if(n>=m&&m>=p)
	{
		cout<<"CAB"<<endl;
	}
	if(n>=p&&p>=m)
	{
		cout<<"ACB"<<endl;
	}
	if(p>=m&&m>=n)
	{
		cout<<"BAC"<<endl;
	}
	if(p>=n&&n>=m)
	{
		cout<<"ABC"<<endl;
	}
	return 0;
}
int main()
{
    int i,j,k,a,b,c;
	for (i=1;i<=3;i++)//??
	     for (j=1;j<=3;j++)
			 for (k=1;k<=3;k++)
			 {
				 a=(j>i)+(i==k);
				 b=(i>j)+(i>k);
				 c=(k>j)+(j>i);
				 if ((i-j)*(a-b)<0&&(i-k)*(a-c)<0&&(j-k)*(b-c)<0)
				 {
					 for(a=1;a<=3;a++)
					 {
						 if (a==i) cout<<'A';
						 if (a==k) cout<<'C';
						 if (a==j) cout<<'B';
					 }
					 return 0;
				 }
			 }
	return 0;
}
//Name:    ???      #
//Author:   ??       #
//Number: 1000062710   #
//Date:  2010?11?23?#
//######################
int main()
{
	int a,b,c,A = 0,B = 0,C = 0;
	while(1)
	{
		A = 1;
		B = 2;
		C = 3;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);
		if((a == 2)&&(b == 1)&&(c == 0))
			cout << "ABC" << endl;
		break;
	}
	while(1)
	{
		A = 1;
		B = 3;
		C = 2;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);
		if((a == 2)&&(c == 1)&&(b == 0))
			cout << "ACB" << endl;
		break;
	}
	while(1)
	{
		B = 1;
		A = 2;
		C = 3;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);
		if((b == 2)&&(a == 1)&&(c == 0))
			cout << "BAC" << endl;
		break;
	}
	while(1)
	{
		B = 1;
		C = 2;
		A = 3;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);

		if((b == 2)&&(c == 1)&&(a == 0))
			cout << "BCA" << endl;
		break;
	}
	while(1)
	{
		C = 1;
		B = 2;
		A = 3;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);
		if((c == 2)&&(b == 1)&&(a == 0))
			cout << "CBA" << endl;
		break;
	}
	while(1)
	{
		C = 1;
		A = 2;
		B = 3;
		a = (B > A) + (C == A);
	    b = (A > B) + (A > C);
	    c = (C > B) + (B > A);
		if((c == 2)&&(a == 1)&&(b == 0))
			cout << "CAB" << endl;
		break;
	}
		return 0;
}
/*
  Name:???
  Author: 120012757(chenminhuan)
  Date: 15/10/12 21:40

*/
void            print(int A,int B,int C){               //??????? 
                //cout<<A<<B<<C<<endl;
                if (A==0) cout<<"A";else
                if (B==0) cout<<"B";else
                cout<<"C"; 
                
                if (A==1) cout<<"A";else
                if (B==1) cout<<"B";else
                cout<<"C"; 
                
                if (A==2) cout<<"A";else
                if (B==2) cout<<"B";else
                cout<<"C"; 
}
int main()
{                     
    
    for(int A = 0 ;A < 3; ++ A)                         //??A???
            for (int B = 0; B < 3 ; ++ B)               //??B??? 
            for (int C = 0; C < 3 ; ++ C)               //??C??? 
            if (A!=B && A!=C && A!=B) 
            if ( (2 - A == (B>A)+(C==A) ) && (2 - B == (A>B)+(A>C)) && (2 - C) ==(C>B)+(B>A))
            //????????? 
                 print(A,B,C); 
                                                          
    
 
    return 0;
}