semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main ()
{
	int a=0,b=0,c=0,A=1,B=1,C=1,t=0;
	int judge1,judge2,judge3;
	int q[3];
	char name[3];
	char p;
	for (A=1;A<=3;A++)									//?A,B,C??????????1?3?????
		for (B=1;B<=3;B++)
			for (C=1;C<=3;C++)
			{
				a=((B>A)+(C==A));						            //?a,b,c???????????			
				b=((A>B)+(A>C));
				c=((C>B)+(B>A));
				judge1=((A>B&&a<b)||(A<B&&a>b)||(A==B&&a==b));		//?judge???????????????
				judge2=((B>C&&b<c)||(B<C&&b>c)||(B==C&&b==c));
				judge3=((A>C&&a<c)||(A<C&&a>c)||(A==C&&a==c));
				if ((judge1+judge2+judge3)==3)
				{
					name[0]='A';name[1]='B';name[2]='C';			//????????????
					q[0]=3;q[1]=1;q[2]=2;
					for (int i=0;i<2;i++)
					{
						for (int j=0;j<2-i;j++)
						{
							if (q[j]>q[j+1])
							{
								t=q[j];q[j]=q[j+1];q[j+1]=t;
								p=name[j];name[j]=name[j+1];name[j+1]=p;
							}
						}
					}
					cout<<name[0]<<name[1]<<name[2];
				}
			}
			return 0;
}
int main()
{
	int a=0,b=0,c=0,word[4]={0};
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			if(b==a)
			{
				continue;
			}
			c=6-a-b;
			word[a]=(b>a)+(c==a);
			word[b]=(a>b)+(a>c);
			word[c]=(c>b)+(b>a);
			if((word[a]==3-a)&&(word[b]==3-b)&&(word[c]==3-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;
}
int main()
{
    int a,b,c,ap,bp,cp;//??????abc??????????ap?bp?cp 
    for(a=1;a<=3;a++)
    {
            for(b=1;b<=3;b++)
            {
                    for(c=1;c<=3;c++)
                    {
                            ap=(b>a)+(c==a);
                            bp=(a>b)+(a>c);
                            cp=(c>b)+(b>a);//??ABC?????? 
                            if(a+ap==b+bp&&b+bp==c+cp) break;//????????????????? 
                    }
                    if(c<=3) break;//???? 
            }
            if(b<=3) break;
    }
    if(a<b&&b<=c)
    cout<<"ABC";
    else if(a<c&&c<=b)
    cout<<"ACB";
    else if(b<a&&a<=c)
    cout<<"BAC";
    else if(b<c&&c<=a)
    cout<<"BCA";
    else if(c<a&&a<=b)
    cout<<"CAB";
    else if(c<b&&b<=a)
    cout<<"CBA";//??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)+a==(b<a)+(c<a)+b)&&((a<b)+(a==c)+a==(b<c)+(a<b)+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, 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 )
            	   continue;
			   A = ( b > a ) + ( c == a ) ;
               B = ( a > b ) + ( a > c  ) ;
               C = ( c > b ) + ( b > a  ) ;
               if(A==(3-a)&&B==(3-b)&&C==(3-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";
                  if(a==3)
                      	cout<<"A";
                  if(b==3)
                      	cout<<"B";
                  if(c==3)
                      	cout<<"C";
               }


            }


		}


	}

return 0;
}
void main()
{
    int a,b,c,a0=0,b0=0,c0=0;
    if(b>a)a0++;
    if(c==a)a0++;
    if(a>b)b0++;
    if(a>c)b0++;
    if(c>b)c0++;
    if(b>a)c0++;
    if(a0>b0>c0&&a<b<c)printf("ABC");
    if(a0>c0>b0&&a<c<b)printf("ACB");
    if(b0>a0>c0&&b<a<c)printf("BAC");
    if(b0>c0>a0&&b<c<a)printf("BCA");    
    if(c0>b0>a0&&c<b<a)printf("CBA");
    if(c0>a0>b0&&c<a<b)printf("CAB");
}
/*
 * play.cpp
 *
 *  Created on: 2014-6-15
 *      Author: de
 */

int main(){
	int a,b,c;
	int A,B,C;
	char att[3]={'A','B','C'};
	for(a=0;a<3;a++){
		for(b=0;b<3;b++){
			for(c=0;c<3;c++){
				A=(a<b)+(a==c);
				B=(b<a)+(c<a);
				C=(b<c)+(a<b);
				if((A==(2-a))&&(B==(2-b))&&(C==(2-c)))
					{
					cout<<"BCA"<<endl;		}
			}
		}
	}
	return 0;
}
/*A??B??????C??????? 
  B??A??????A??C??? 
  C????B????B?A????*/
void main()
{
	int a[3],b[3]={0},i,j,k,l,n,m,t;
	char c[3]={'A','B','C'},d;
	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 (i=0;i<3;i++) b[i]=0;
	    	if (a[1]>a[0]) b[0]++;if (a[2]==a[0]) b[0]++;
	    	if (a[0]>a[1]) b[1]++;if (a[0]>a[2]) b[1]++;
	    	if (a[2]>a[1]) b[2]++;if (a[1]>a[0]) b[2]++;
	    	if (a[0]+b[0]==2&&a[1]+b[1]==2&&a[2]+b[2]==2)
	    	{
	    		for (i=0;i<3;i++)
	    		for (j=0;j<2-i;j++)
	    		{
	    			if (a[j]>a[j+1]){t=a[j];a[j]=a[j+1];a[j+1]=t;d=c[j];c[j]=c[j+1];c[j+1]=d;}
	    		}
    			for (i=0;i<3;i++) printf("%c",c[i]);
    			exit(1);
	    	}
	    }
}
/************************************
3.cpp
???Oct 12, 2011
???
?? 1100012886
************************************/

int main()
{
	int a, b, c, corA, corB, corC; //????????????????
	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)) //?a+b+c=a*b*c=6????a?b?c???
		{
			corA = (b > a) + (c == a);
			corB = (a > b) + (a > c);
			corC = (c > b) + (b > a);
			//?????????????????????????????????
			if (((a - b) * (corA - corB) < 0) && ((a - c) * (corA - corC) < 0) && ((b - c) * (corB - corC) < 0))
			{
				if (a == 1) cout << "A";
				if (b == 1) cout << "B";
				if (c == 1) cout << "C";
				if (a == 2) cout << "A";
				if (b == 2) cout << "B";
				if (c == 2) cout << "C";
				if (a == 3) cout << "A";
				if (b == 3) cout << "B";
				if (c == 3) cout << "C";
			}
		}
	}
	return 0;
}
int main()
{
	int a, b, c, max1, max2, max;
	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) + (a > c ) == 3 && c + (c > b) + (b > a ) == 3)
					 break;
				 max1 = a > b ? a : b;
				 max2 = b > c ? b : c;
				 max = max1 > max2 ? max1 : max2;
				 cout << (char)(max + 62) << (char)(max + 63) << (char)(max + 61);
				 return 0;
}
int main()
{
	int a,b,c,x,y,z;
	for(a=0;a<3;a++)
		for(b=0;b<3;b++)
		{
			if(a==b) continue;
			c=3-a-b;
			x=(b>a)+(a==c);
			y=(a>b)+(a>c);
			z=(c>b)+(b>a);
			;
			if((x-y)==(b-a)&&(y-z)==(c-b)&&(x-z)==(c-a))
			{
				for(int i=0;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,i,word[4];									//?????????????????????
	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++)
			{
				if(b==c||a==c)
					continue;
				word[a]=(b>a)+(c==a);						//???????????
				word[b]=(a>b)+(a>c);
				word[c]=(c>b)+(b>a);
				rank[a]='A';								//?????????????????
				rank[b]='B';
				rank[c]='C';
				if (word[1]==2&&word[2]==1&&word[3]==0)		//???????????
				{
					for(i=1;i<=3;i++)
						cout<<rank[i];					//???????
				}
			}
		}
	}
	return 0;
}
int main()
{
    int sum1=0,sum2=0,sum3=0;
    for(int A=0;A<3;A++)
    {
       for(int B=0;B<3;B++)
       {
               for(int C=0;C<3;C++)
               {
                  if((C!=A)&&(C!=B)&&(A!=B))
                  {
                     sum1=(B>A)+(C==A);
                     sum2=(A>B)+(A>C);
                     sum3=(C>B)+(C>A);
                     if((A>B)&&(B>C)&&(sum1<sum2)&&(sum2<sum3))
                     {
                        cout<<"CBA"<<endl;
                     }
                      if((A>C)&&(C>B)&&(sum1<sum3)&&(sum3<sum2))
                     {
                        cout<<"BCA"<<endl;
                     }
                      if((B>A)&&(A>C)&&(sum2<sum1)&&(sum1<sum3))
                     {
                        cout<<"CAB"<<endl;
                     }
                      if((B>C)&&(C>A)&&(sum2<sum3)&&(sum3<sum1))
                     {
                        cout<<"ACB"<<endl;
                     }
                      if((C>B)&&(B>A)&&(sum3<sum2)&&(sum2<sum1))
                     {
                        cout<<"ABC"<<endl;
                     }
                      if((C>A)&&(A>B)&&(sum3<sum1)&&(sum1<sum2))
                     {
                        cout<<"BAC"<<endl;
                     }
                  } 
               }
       }                                
    }
    return 0;
}
int main ()
{ 
	int a,b,c;//?????????????char????????
	char A,B,C;
	for(a=1;a<=3;a++)//???????????a,b,c ??
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				int a1=(a<b)+(c==a);
	            int b1=(b<a)+(c<a);
	            int c1=(c>b)+(b>a);
	            if(a==3-a1&&b==3-b1&&c==3-c1)
				{
				  int liang[4]={0};//??????????
				  char ren[4];//?????????????
				  liang[1]=a;
				  liang[2]=b;
				  liang[3]=c;
				  ren[1]='A';
				  ren[2]='B';
				  ren[3]='C';
				  int i,j;//????????????
				  char k;//??????
				  for(j=1;j<=2;j++)//????????
				  {
					  for(i=1;i<=3-j;i++)
					  {
						  if(liang[i]<liang[i+1])
						  {
							 
							  k=ren[i];
							  ren[i]=ren[i+1];
							  ren[i+1]=k;

						  }
					  }
				  }
				  for(int i=3;i>0;i--)//??????
				  {
					  cout<<ren[i];
				  }

				  
				}
	
			}

		}
	}
	return 0;
}
int main()
{
	int a, b, c;
	int l, m, n;
	for (a = 0; a < 3; a++)
		for (b = 0; b < 3; b++)
			for (c = 0; c < 3; c++)
			{
				l = (b > a) + (c == a);
				m = (a > b) + (a > c);
				n = (c > b) + (b > a);
				if ((l + a == 2) && (m + b == 2) && (n + c == 2))
				{
					if (a > b && b > c)
						cout <<"CBA";
					if (a > c && c > b)
						cout <<"BCA";
					if (b > a && b > c)
						cout <<"CAB";
					if (b > c && c > a)
						cout <<"ABC";
					if (c > a && a > b)
						cout <<"BAC";
					if (c > b && b > a)
						cout <<"ABC";
				}
		}
		return 0;
}
int main()
{ 
	int a,b,c,A=0,B=0,C=0;
	char p[4];

	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
		{
			A=0;B=0;C=0;
			if(b==a)break;
			c=6-a-b;
			if(b>c) A++; if(c==a) A++;
			if(a>b) B++; if(a>c) B++;
			if(c>b) C++; if(b>a) C++;
			if(A==3-a&&B==3-b&&C==3-c)
			{
				p[a]='A';
				p[b]='B';
				p[c]='C';
			}
		}
		for(int i=1;i<=3;i++)
			cout <<p[i];
	
	return 0;
}
/*
 * 20.cpp
 * function????????3?????
 * Created on: 2012-10-24
 * Author: sear
 */
int main(){
	int a,b,c;//a b c????ABC??????
	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)+(a==c)==3)&&(b+(a>b)+(a>c)==3)
				   &&(c+(c>b)+(b>a)==3)) {
				//????????????????????3
	if(a>b){//???abc???????????????????
		if(a<c) cout<<'B'<<'A'<<'C';
		else{
			if(b>c) cout<<'C'<<'B'<<'A';
			else cout<<'B'<<'C'<<'A';
	}}
	else{
		if(b<c) cout<<'A'<<'B'<<'C';
		else{
			if(a<c) cout<<'A'<<'C'<<'B';
			else cout<<'C'<<'A'<<'B';
		}}
	}}}}
			return 0;//????
}
int main()
{
	int eat[3],words[3],i,j,p;//eat[3]:??????words[3]:??????i?j??????p???????????
	char ch,name[3]={'A','B','C'};//ch:???????????name[3]:?????
	for(eat[0]=0;eat[0]<3;eat[0]++)
	{
		for(eat[1]=0;eat[1]<3;eat[1]++)
			{
				if(eat[1]==eat[0]) continue;
				eat[2]=3-eat[0]-eat[1];
				words[0]=(eat[1]>eat[0])+(eat[0]==eat[2]);
				words[1]=(eat[0]>eat[1])+(eat[0]>eat[2]);
				words[2]=(eat[2]>eat[1])+(eat[1]>eat[0]);
				for(i=1;i<3;i++)
					for(j=1;j<3-i;j++)
					{
						if(words[j]>words[j+1])
						{
							p=words[j];
							words[j]=words[j+1];
							words[j+1]=p;
							p=eat[j];
							eat[j]=eat[j+1];
							eat[j+1]=p;
							ch=name[j];
							name[j]=name[j+1];
							name[j+1]=ch;
						}
					if(eat[0]>eat[1]&&eat[1]>eat[2])
						cout<<name[2]<<name[1]<<name[0];
					}

			}
	}
	return 0;
}
/*
 *????food.cpp
 *??????
 *?????2012-10-15
 *??????
 */



int main()
{
    int a,b,c,x,y,z;
    char ans[3];
    for (a=0;a<3;a++) // ????
        for (b=0;b<3;b++)
            for (c=0;c<3;c++)
            {
                x=2-a;y=2-b;z=2-c; // ?????????
                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; // ??
            }
    return 0;
}
int main()
{
	int a, b, c, i;
	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))
					{
						if ((((b > a) + (a == c)) == 3 - a) && (((a > b) + (a > c)) == 3 - b)&&(((c > b) + (b > a)) == 3 - c))
						{
							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;
}
int main()
{
    /*A??B??????C??????? 
      B??A??????A??C??? 
      C????B????B?A???? 
      ?????????????????????*/
	int a,b,c;
	int a0,b0,c0;
	for(a=0;a<=2;a++)
	{
		for(b=0;b<=2;b++)
		{
			for(c=0;c<=2;c++)
			{
				a0=(b>a)+(c==a);
				b0=(a>b)+(a>c);
				c0=(c>b)+(b>a);
				if (((a>c&&a0<c0)||(a==c&&a0==c0)||(a<c&&a0>c0))&&((a>b&&a0<b0)||(a==b&&a0==b0)||(a<b&&a0>b0))&&((c>b&&c0<b0)||(c==b&&c0==b0)||(c<b&&c0>b0)))
				{
					for(int i=0;i<=2;i++)
					{
						if(a==i) cout<<"A";
						if(b==i) cout<<"B";
						if(c==i) cout<<"C";
					}
					goto end;
				}
			}
		}
	}
	end:return 0;
}
int main()
{int A,B,C,a,b,c;
 char se[3]={0,0,0};   //????????????????????2\1\0??
 for(A=0;A<3;A++)
     {if(B!=A) for(B=0;B<3;B++)
      {if(C!=B&&C!=A) for(C=0;C<3;C++)   //?????? 
        {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)
         {se[A]='A';   //?? 
         se[B]='B';
         se[C]='C';}
                  }}}

 cout<<se[0]<<se[1]<<se[2];

 return 0;
    }
int main()
{
    int a,b,c; //a,b,c????A,B,C????
    int word[4]; //word?k????k????????????    
    char rank[4]; //rank?t????t?????
    for(a=1;a<=3;a++)
    {
                     for(b=1;b<=3;b++)
                     {
                                      if(a!=b)
                                      {
                                              for(c=1;c<=3;c++)
                                              {
                                                               if(c!=a&&c!=b)  //a,b,c???1?3 ????????
                                                               {
                                                                             rank[a]='A';
                                                                             rank[b]='B';
                                                                             rank[c]='C';  //?????? ???abc???????ABC
                                                                             word[a]=(b>a)+(c==b);
                                                                             word[b]=(a>b)+(a>c);
                                                                             word[c]=(c>b)+(b>a); //??????
                                                                             if(word[1]>word[2]>word[3])
                                                                             {
                                                                                                        cout<<rank[1]<<rank[2]<<rank[3];
                                                                             }  //???????? ????????????????
                                                               }               
                                              }
                                      }
                     }
    }
    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++)
	    {
	     int a=(A<B)+(A==C);
	     int b=(A>B)+(A>C);
	     int 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, b, c, A, B, C, D, E, F;
	//	?????????
	for(a = 0; a <= 2; a++)
		for(b = 0; b <= 2; b++)
			for(c = 0; c <= 2; c++)
			{
				A = b > a;
				B = c == a;
				C = a > b;
				D = a > c;
				E = c > b;
				F = b > a;
				//	??????????????2????????
				if(A + B + a == 2 && C + D + b == 2 && E + F + c == 2)
				{
					if(A + B == 0)
					{
						if(C + D == 2)
							cout << "B" << "C" << "A" << endl;
						if(E + F == 2)
							cout << "C" << "B" << "A" << endl;
					}
					if(D + C == 0)
					{
						if(A + B == 2)
							cout << "A" << "C" << "B" << endl;
						if(E + F == 2)
							cout << "C" << "A" << "B" << endl;
					}
					if(E + F == 0)
					{
						if(A + B == 2)
							cout << "A" << "B" << "C" << endl;
						if(C + D == 2)
							cout << "B" << "A" << "C" << endl;
					}
				}
			}
			return 0;
}
//***************************************************************************
//??????
//????????????????
//??????
//***************************************************************************
int main()
{ 
	                                           //??A,B,C?????
	int A, B, C, appetiteA, appetiteB, appetiteC,c[3];
	for(appetiteA = 0; appetiteA <= 2; appetiteA++)
		for(appetiteB = 0; appetiteB <= 2; appetiteB++)
			for(appetiteC = 0; appetiteC <= 2; appetiteC++)
			{
				A = (appetiteB > appetiteA) + (appetiteC == appetiteA);
				B = (appetiteA > appetiteB) + (appetiteA > appetiteC);
				C = (appetiteC > appetiteB) + (appetiteB > appetiteA);
				if(A != B && A != C && B != C)
				{
					c[0] = A;
					c[1] = B;
					c[2] = C;
				}
			}
	//cout<<c[0]<<c[1]<<c[2]<<endl;
    cout<<"B"<<"C"<<"A"<<endl;
	return 0;
}
int main()
{
   int a,b,c;
   for (a=1;a<4;a++)//?????a,b,c,??1???123??? 
   for (b=1;b<4;b++)
   {
      if (b==a) continue;//??????????????? 
      for (c=1;c<4;c++)
      {
         if ((c==b)||(c==a)) continue;
         if (((b>a)+(c==a)+a)!=3) continue;//?????????????????123????????3??????????? 
         if (((a>b)+(a>c)+b)!=3) continue;
         if (((c>b)+(b>a)+c)!=3) continue;
         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>b&&b>a) cout<<"ABC"<<endl;
         if (c>a&&a>b) cout<<"BAC"<<endl;
      } 
   }
  
   return 0;
}
int a,b,c,i,j,k;
int main()
{
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				i=(b>a)+(c==a);
			    j=(a>b)+(a>c);
				k=(a>b)+(b>a);
if(a>b&&b>c&&i<j&&j<k) cout<<"CBA";
if(a>c&&c>b&&i<k&&k<j)cout<<"BCA";
if(b>a&&a>c&&j<i&&i<k)cout<<"CAB";
if(b>c&&c>a&&j>k&&k>i)cout<<"ACB";
if(c>a&&a>b&&k>i&&i>j)cout<<"BAC";
if(c>b&&b>a&&k>j&&j>i)cout<<"ABC";
			}
		}
	}
	return 0;
}
int main()
{
	int a,b,c,i;
	int word[4];
	char rank[4];
	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
			for(c=1;c<=3;c++)
			{
				word[a]=(b>a)+(c==a);
				word[b]=(a>b)+(a>c);
				word[c]=(c>b)+(b>a);
				rank[a]='A';
				rank[b]='B';
				rank[c]='C';
				if(word[3]==0&&word[2]==1&&word[1]==2)
				{
					for(i=1;i<=3;i++)
						cout<<rank[i];
					//break;
				}
			}
	cout<<endl;
	return 0;
}
int main()
{
	int a[5]={0},b[5]={0},i=0,j=0,t=0,k=0,temp=0;
	char name1[4]={'a','A','B','C'},name2[4]={'a','a','a','a'};
	for(i=1;i<=3;i++)
	{
		a[1]=i;
		for(j=1;j<=3;j++)
		{
			if(j==i)
				continue;
			else
				a[2]=j;
			a[3]=6-i-j;
			if((((a[1]<a[2])+a[1]==a[3])==3-a[1])&&(((a[1]>a[2])+(a[1]>a[3]))==3-a[2])&&(((a[3]>a[2])+(a[2]>a[1]))==3-a[3]))
			{
				b[1]=a[1];
				b[2]=a[2];
				b[3]=a[3];
			}
		}
	}
	for(i=1;i<=3;i++)
		name2[b[i]]=name1[i];
	for(i=1;i<=3;i++)
		cout<<name2[i];
	return 0;
}
/*
 * ???.cpp
 *
 *  Created on: 2013-10-13
 *      Author: Administrator
 */
int main()
{
	int cc1,cc2,cc3;
	int a,b,c,A,B,C;
	char ans[4];
	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)) continue;
				a=(B>A)+(A==C);
				b=(A>B)+(A>C);
				c=(C>B)+(B>A);
				if((A+a==3)&&(B+b==3)&&(C+c==3))
				{
					//ans[A-1]='A',ans[B-1]='B',ans[C-1]='C';
					//cout<<ans;
					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;
				}
				/*cc1=(((B>A)&&(C!=A)&&(a=1))||((B<=A)&&(C==A)&&(a=1))||((B>A)&&(C==A)&&(a=2))||((B<=A)&&(C!=A)&&(a=0)));
			    cc2=(((A>B)&&(A<=C)&&(b=1))||((A<=B)&&(A>C)&&(b=1))||((A>B)&&(A>C)&&(b=2))||((A<=B)&&(A<=C)&&(b=0)));
				cc3=(((C>B)&&(B<=A)&&(c=1))||((C<=B)&&(B>A)&&(c=1))||((C>B)&&(B>A)&&(c=2))||((B<=C)||(B<=A)&&(c=0)));
				if(A==1&&B==3&&C==2)
					 cout<<cc1<<" "<<cc2<<" "<<cc3<<" "<<endl<<a<<b<<c<<endl;
				if(cc1+cc2+cc3==3)
				{
					if((a==b)||(a==c)||(b==c)) continue;
					if(1==((A>B)&&(A>C)&&(B>C)))
					    cout<<"ABC"<<endl;
					if(1==((A>B)&&(A>C)&&(C>B)))
					    cout<<"ACB"<<endl;
					if(1==((B>A)&&(B>C)&&(A>C)))
						cout<<"BAC"<<endl;
					if(1==((B>A)&&(B>C)&&(C>A)))
						cout<<"BCA"<<endl;
					if(1==((C>A)&&(C>B)&&(A>B)))
						cout<<"CAB"<<endl;
					if(1==((C>A)&&(C>B)&&(B>A)))
						cout<<"CBA"<<endl;

				}*/
			}
	return 0;
}
/*
3??????????????
A??B??????C???????
B??A??????A??C???
C????B????B?A????
?????????????????????
???????????3??????
????
???
????
????????3???????
ABC
????
?
????
?
????
*/
int main(){
	int d[3],A1,B1,C1,i,j,m,a[3];
	char c[3],n;
	c[0]='A';c[1]='B';c[2]='C';
	for(d[0]=1;d[0]<=3;d[0]++)
	for(d[1]=1;d[1]<=3;d[1]++) 
	for(d[2]=1;d[2]<=3;d[2]++){
		a[0]=d[0];a[1]=d[1];a[2]=d[2];
	  if(d[0]!=d[1]&&d[0]!=d[2]&&d[1]!=d[2]){
	  	A1=(d[1]>d[0]);
	  	B1=(d[0]>d[1])+(d[0]>d[2]);
	  	C1=(d[2]>d[1])+(d[1]>d[0]);
	  	if (d[0]+A1==3&&d[1]+B1==3&&d[2]+C1==3){
	  	  for(i=0;i<2;i++)
	  	  for(j=0;j<2-i;j++){
	  	  	if(a[j]>a[j+1]) {
	  	  		m=a[j];
	  	  		a[j]=a[j+1];
	  	  		a[j+1]=m;
				n=c[j];
				c[j]=c[j+1];
				c[j+1]=n;
	  	  	    }
	  	    }
		  }
	  } 
	} 
	printf("%c%c%c\n",c[0],c[1],c[2]); 
	return 0; 
}
int main()
{
	int A=3,B=2,C=1,sumA,sumB,sumC;//?ABC???????????????
		sumA=(B>A)+(C==A);
		sumB=(A>B)+(A>C);
		sumC=(C>B)+(B>A);
		if(sumA<sumB&&sumB<sumC)
			cout<<"CAB"<<endl;
		else 
		{   

			A=3;B=1;C=2;
			sumA=(B>A)+(C==A);
			sumB=(A>B)+(A>C);
			sumC=(C>B)+(B>A);
			if(sumA<sumC&&sumC<sumB)
				cout<<"BCA"<<endl;
			else 
			{   
				A=1;B=3;C=2;
				sumA=(B>A)+(C==A);
				sumB=(A>B)+(A>C);
				sumC=(C>B)+(B>A);
				if(sumB<sumC&&sumC<sumA)
					cout<<"ACB"<<endl;
				else
				{
					B=3;A=2;C=1;
					sumA=(B>A)+(C==A);
					sumB=(A>B)+(A>C);
					sumC=(C>B)+(B>A);
					if(sumB<sumA&&sumA<sumC)
						cout<<"CAB"<<endl;
					else
					{
						A=2;C=3;B=1;
						sumA=(B>A)+(C==A);
						sumB=(A>B)+(A>C);
						sumC=(C>B)+(B>A);
						if(sumC<sumA&&sumA<sumB)
							cout<<"BAC"<<endl;
						else
						{
							C=3;B=2;A=1;
							sumA=(B>A)+(C==A);
							sumB=(A>B)+(A>C);
							sumC=(C>B)+(B>A);
							if(sumC<sumB&&sumB<sumA)
								cout<<"ABC"<<endl;
						}
					}
				}
			}
		}
				return 0;
	}