semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int A,B,C,i;int words[4];char rank[3];
	for(A=0;A<=2;A++){
		for(B=0;B<=2;B++){
        if(A==B)continue;
		C=3-A-B;//??????
		words[1]=(B>A)+(C==A);
		words[2]=(A>B)+(A>C);
        words[3]=(C>B)+(B>A);//???????????
		if(words[1]+A==2&&words[2]+B==2&&words[3]+C==2)//????????????????????????3
		{
			rank[A]='A';
			rank[B]='B';
			rank[C]='C';
	}}}
			cout<<rank[0]<<rank[1]<<rank[2];//????
		return 0;
}
int main()
{
	int a,b,c,as,bs,cs;
	for (a=1;a<=3;a++)
		for(b=1;b<=3;b++)
			for(c=1;c<=3;c++)
			{
				as=(b>a)+(c==a);
				bs=(a>b)+(a>c);
				cs=(c>b)+(b>a);
				if (!((a<=b)&&(as<=bs)||(a<=c)&&(as<=cs)||(b<=a)&&(bs<=as)||(b<=c)&&(bs<=cs)||(c<=a)&&(cs<=as)||(c<=b)&&(cs<=bs)))
				{
					char shuzu[4];
				shuzu[a]='A';
				shuzu[b]='B';
				shuzu[c]='C';
				for (int i=1;i<=3;i++)
					cout<<shuzu[i];
				}
			}
			return 0;
}
//
//  main.cpp
//  poj
//
//  Created by ChuPan,Wong on 9/27/13.
//  Copyright (c) 2013 ChuPan,Wong. All rights reserved.
//


int main(int argc, const char * argv[])
{
    int A,B,C;
    int a,b,c;
    for(int i=1;i<4;i++){
        for(int j=1;j<4;j++){
            for(int k=1;k<4;k++){
                A = i; B = j; C = k;
                a = (int)(B>A) + (int)(A==C);
                b = (int)(A>B) + (int)(A>C);
                c = (int)(C>B) + (int)(B>A);
                if(!((A>=B&&a>b)||(A>=C&&a>c)||(B>=A&&b>a)||(B>=C&&b>c)
                   ||(C>=A&&c>a)||(C>=B&&c>b))){
                    if(A>=B&&B>=C)
                        cout<<"ABC"<<endl;
                    else if(A>=C&&C>=B)
                        cout<<"ACB"<<endl;
                    else if(B>=A&&A>=C)
                        cout<<"BAC"<<endl;
                    else if(B>=C&&C>=A)
                        cout<<"BCA"<<endl;
                    else if(C>=A&&A>=B)
                        cout<<"CAB"<<endl;
                    else
                        cout<<"CBA"<<endl;
                    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(((b > a) + (c == a) == 3 - a) && ((a > b) + (a > c) == 3 - b) && ((c > b) + (b > a) ==3 - c))
				  {
					 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 < a && a < b)  cout << 'C' << 'A' << 'B';
                     if (c < b && b < a)  cout << 'C' << 'B' << 'A';
				  }
			  }
			  return 0;
}
/* ???????
 * ??????
 * ?????2012-10-17
 * ???3?????????????? 
 *       A??B??????C??????? 
 *       B??A??????A??C??? 
 *       C????B????B?A???? 
 *       ????????????????????? 
 *       ????????3??????
 */

int main ()
{
	int a,b,c,cc1,cc2,cc3,i,j,n[3],k;//??A,B,C????????a,b,c;???????????cc1,cc2,cc3;k?????
	char m[] = {'A','B','C'},D;//D?????
	for (a = 1; a <= 3; a++)//????a,b,c??????
		for (b = 1; b <= 3; b++)
			for (c = 1; c <= 3; c++)
			{
				cc1 = (b < a) + (c == a);//???????????????
				cc2 = (a < b) + (a < c);
				cc3 = (c < b) + (b < a);
				if ((cc1 + 1) == a && (cc2 + 1) == b && (cc3 + 1) == c)//???????????????????a,b,c?????????n?
				{
					n[0] = a;
					n[1] = b;
					n[2] = c;
				}
			}
	for (i = 0; i <= 1; i++)//??????a,b,c?????????
		for (j = 0; j <= 1 - i; j ++)//????
		{
			if (n[j] < n[j + 1])//????????a,b,c?????????m?A,B,C????n??a,b,c
			{
				k = n[j];
				n[j] = n[j + 1];
				n[j + 1] = k;
				D = m[j];
				m[j] = m[j + 1];
				m[j + 1] = D;
			}
		}
    cout << m[0] << m[1] << m[2] << endl;//?????3???
	return 0;
}
char namef(int a,int b,int c,int n)
{
	int i;
	char name[3];
	for(i=0;i<3;i++)
	{
		if(a==i)
		{
			name[i]='A';
		}
		if(b==i)
		{
			name[i]='B';
		}
		if(c==i)
		{
			name[i]='C';
		}
	}	
	return name[n];
}
char numf(int a,int b,int c,int n)
{
	int i;
	char num[3];
	for(i=0;i<3;i++)
	{
		if(a==i)
		{
			num[i]='a';
		}
		if(b==i)
		{
			num[i]='b';
		}
		if(c==i)
		{
			num[i]='c';
		}
	}	
	return num[n];

}

int main()
{
	int a,b,c,A,B,C,i,j;
	char name[3],num[3];
	for(a=0;a<3;a++)
	{
		for(b=0;b<3;b++)
		{
			if(a==b)
			{
				continue;
			}
			for(c=0;c<3;c++)
			{
				if((c==b)||(c==a))
				{
					continue;
				}
				A=(b>a)+(c==a);
				B=(a>b)+(a>c);
				C=(c>b)+(b>a);
				for(j=0;j<3;j++)
				{
					num[j]=numf(a,b,c,j);
					name[j]=namef(A,B,C,j);
				}
				if((num[0]==name[2]+32)&&((num[2]==name[0]+32)&&(num[1]==name[1]+32)))
				{
					for(i=2;i>=0;i--)
					{
						printf("%c",name[i]);
					}
				}
			}
		}
	}
	return 0;
}
int i,j,k,a[3],b[3],c[3],d[3],p,q;
int main(){
	for(i=0;i!=2;i++)
		for(j=0;j!=2;j++)
			if(i!=j)
			for(k=0;k!=2;k++){
				a[0]=i;a[1]=j;a[2]=k;
				b[0]=(j>i)+(i==k);b[1]=(i>j)+(i>k);b[2]=(k>j)+(j>i);
				c[0]=0;c[1]=1;c[2]=2;
				d[0]=0;d[1]=1;d[2]=2;
				for(p=0;p!=2;p++)
					for(q=p+1;q!=3;q++){
						if(a[c[p]]>a[c[q]]){
							c[p]=c[p]^c[q];
							c[q]=c[p]^c[q];
							c[p]=c[p]^c[q];
						}
						if(b[d[p]]<b[d[q]]){
							d[p]=d[p]^d[q];
							d[q]=d[p]^d[q];
							d[p]=d[p]^d[q];
						}
					}
			if((c[0]==d[0])&&(c[1]==d[1])&&(c[2]==d[2])){
				printf("%c%c%c\n",c[2]+65,c[1]+65,c[0]+65);
			}
			}
}
int main()
{
	char ch;
	int a=0,b=0,c=0,r,s,t,P[3],i;
	r=(b>a)+(c==a);
    s=(a>b)+(a>c);
    t=(c>b)+(b>a);//??????????
    for (a=0;a<=2;a++)
	{for(b=0;b<=2;b++)
	{for(c=0;c<=2;c++)//????????????????
	{
	if((r+a==2)&&(s+b==2)&&(t+c==2))//????
	{
	P[0]=a;P[1]=b;P[2]=c;}
    }}}
	for(i=0;i<=2;i++)
	{if (P[i]==2) {ch=i+65;cout<<ch;}}
	for(i=0;i<=2;i++)
	{if (P[i]==1) {ch=i+65;cout<<ch;}}
    for(i=0;i<=2;i++)
	{if (P[i]==0) {ch=i+65;cout<<ch;}}


	return 0;
}
int main()
{
	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 >= c && A <= B && A <= C && b >= c && B <= C){
					cout << "ABC" << endl;
					goto loop;
				}
				if(a >= b && a >= c && A <= B && A <= C && b <= c && B >= C){
					cout << "ACB" << endl;
					goto loop;
				}
				if(a <= b && a <= c && A >= B && A >= C && b >= c && B <= C){
					cout << "BCA" << endl;
					goto loop;
				}
				if(a <= b && a <= c && A >= B && A >= C && b <= c && B >= C){
					cout << "CBA" << endl;
					goto loop;
				}
				if(c >= a && c >= b && C <= A && C <= B && a >= b && A <= B){
					cout << "CAB" << endl;
					goto loop;
				}
				if(b >= a && b >= c && B <= A && B <= C && a >= c && A <= C){
					cout << "BAC" << endl;
					goto loop;
				}
			}
		}
	}
loop :
	return 0;
}
int main ()
{
	int a = 0, b = 0, c = 0;															//??abc?0,1,2?????????
	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 ) continue;								//??a?b?c???????
				if ((2-a == ((b>a)+(c==a)))&&(2-b == ((a>b)+(a>c)))&&(2-c == ((c>b)+(b>a))))	//??????????
				{
					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;
}
/*3?????????????? 
A??B??????C??????? 
B??A??????A??C??? 
C????B????B?A???? 
????????????????????? 
???????????3??????*/

int main()
{
	int a,b,c;
	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
		{
			if(b==a) continue;
			for(c=1;c<=3;c++)
			{
				if(c==a||c==b) continue;
				if((b>a)+(c==a)+a==3)
					if((a>b)+(a>c)+b==3)
						if((c>b)+(b>a)+c==3)
						{
							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;
}
/*
 * 3.cpp
 *
 *  Created on: 2013-10-19
 *      Author: Administrator
 */

int main()
{
    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)+(a==c);
				B=(a>b)+(a>c);
				C=(c>b)+(b>a);

					if(A>B&&B>C&&a<b&&b<c)
					{
						cout<<"A"<<"B"<<"C"<<endl;
					}
					if(A>C&&C>B&&a<c&&c<b)
					{
					    cout<<"A"<<"C"<<"B"<<endl;

					}
					if(B>A&&A>C&&b<a&&a<c)
					{
					    cout<<"B"<<"A"<<"C"<<endl;

					}
					if(B>C&&C>A&&b<c&&c<a)
					{
					    cout<<"B"<<"C"<<"A"<<endl;

					}
					if(C>B&&B>A&&c<b&&b<a)
					{
				        cout<<"C"<<"B"<<"A"<<endl;
					}
					if(C>A&&A>B&&c<a&&a<b)
					{
						cout<<"C"<<"A"<<"B"<<endl;

					}

			}
	return 0;
}
int main()
{
    int a,b,c;//a b c ????????????
    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)//?????????????????????????
                    continue;
                A=2-a;//?????
                B=2-b;
                C=2-c;
                if(a == ((B > A)+(C == A)))//a????????
                if(b == ((A > B)+(A > C)))
                if(c == ((C > B)+(B > A)))
                {
                    for(int i=0;i<=2;i++)
                    {
                        if(i==A)//????????????????????
                            cout <<"A";
                        else if(i==B)
                            cout <<"B";
                        else if(i==C)
                            cout <<"C";
                    }
                        cout <<endl;
                }
            }
    return 0;
}
/**
 * ????bifanliang.cpp
 * ????????
 * ??????
 * ???2010.11.19
 */



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

	return 0;
}
int main()
{
	int A,B,C;
	for(int a = 1;a <= 3;a ++)
		for(int b = 1;b <= 3;b ++)
			for(int c = 1;c <= 3;c ++){
				A = (a < b) + (a == c);
				B = (a > b) + (a > c);
				C = (c > b) + (b > a);
				if(a < b && b < c && A > B && B > C) printf("ABC\n");
				if(a < c && c < b && A > C && C > B) printf("ACB\n");
				if(b < a && a < c && B > A && A > C) printf("BAC\n");
				if(b < c && c < a && B > C && C > A) printf("BCA\n");
				if(c < a && a < b && C > A && A > B) printf("CAB\n");
				if(c < b && b < a && C > B && B > A) printf("CBA\n");
			}
	return 0;
}
int main()
{
	int a=0,b=0,c=0,word[3]={0},i=0;
	char rank[3]={0};
	for(a=0;a<=2;a++)
	{
		for(b=0;b<=2;b++)
		{
			if(b==a)
			{
				continue;
			}
			c=3-a-b;
			word[a]=(b>a)+(c==a);
			word[b]=(a>b)+(a>c);
			word[c]=(c>b)+(b>a);
			rank[a]=65;
			rank[b]=66;
			rank[c]=67;
			if(word[a]==2-a&&word[b]==2-b&&word[c]==2-c)
			{
				for(i=0;i<=2;i++)
				{
					cout<<rank[i];
				}
			}
		}
	}
	return 0;
}
/*
 * 10.11???.cpp
 *
 *  Created on: 2013-10-11
 *      Author: Administrator
 */

int main()
{int A,B,C,a1,a2,b1,b2,c1,c2,flag=0;
for(A=0;A<=2;A++)
{for(B=0;B<=2;B++)
	{if(B!=A)
	   {
	    for(C=0;C<=2;C++)
	     {a1=a2=b1=b2=c1=c2=0;
	    	if((C!=B)&&(C!=A))
	       { if(B>A)
	    	     a1=1;
	         if(A>B)
	        	 b1=1;
	         if(A>C)
	        	 b2=1;
	         if(C>B)
	        	 c1=1;
	         if(B>A)
	        	 c2=1;
	         if((A+a1+a2==2)&&(B+b1+b2==2)&&(C+c1+c2==2))
	        	 {
	        	 flag=1;
	        	 break;
	        	 }
	        }
	       }
	     }
	 if(flag)
		 break;
	}
if(flag)
	break;
}
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;
}
/*
 * bifanliang.cpp
 *
 *  Created on: 2012-10-21
 *      Author: ??
 *      ????????3??????
 */


int main(){
     int A,B,C,i;                    //????

     for(A=0; A<=2 ;A++)
        for(B=0; B<=2 ;B++)
    	  for(C=0 ;C<=2 ;C++)
    	      for(i=0 ;i<=2 ;i++)  //A,B,C??????

      if((B>A)+(C==A)+A==2
          &&(A>B)+(A>C)+B==2
          &&(C>B)+(B>A)+C==2)       //????????????????
     {if(A==i) cout<<"A";
      if(B==i) cout<<"B";
      if(C==i) cout<<"C";}          //????????

     return 0;

}
/**
* @file 1000010424_4.cpp
* @author ???
* @date 2010?11?17
* @description
* ??????:???
*/



int main()
{
	int rice[3];						//???-1?0?1??????; 1???
	char name[3] = {'A', 'B', 'C'};		//????????
	int right[3];						//???????right[i]+rice[i]==1?
	int i;

	for(rice[0] = -1; rice[0] <= 1; rice[0]++)
		for(rice[1] = -1; rice[1] <= 1; rice[1]++)
			if(rice[1] != rice[0])
				for(rice[2] = -1; rice[2] <= 1; rice[2]++)
					if(rice[2] != rice[1] && rice[2] != rice[0])
					{
						right[0] = (rice[1] > rice[0]) + (rice[2] == rice[0]);
						right[1] = (rice[0] > rice[1]) + (rice[0] > rice[2]);
						right[2] = (rice[2] > rice[1]) + (rice[1] > rice[0]);

						if((rice[0] + right[0]) == 1 && (rice[1] + right[1]) == 1 && (rice[2] + right[2]) == 1)
						{
							for(i = 0; rice[i] != -1; i++)
								;
							cout << name[i];	//?????

							for(i = 0; rice[i] != 0; i++)
								;
							cout << name[i];	

							for(i = 0; rice[i] != 1; i++)
								;
							cout << name[i];	//?????
		
							cout << endl;
						}
					}
	
	return 0;
}
int f(int a,int b)
{   int c;
    if(a>=b)
    c=1;
    else
    c=0;
    return c;
}
int main()
{
    int a,b,c,A,B,C,sum,g=0,s=0;
    for(A=1;A<4;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);
             sum = (f(A,B)+f(a,b)==1)+(f(B,C)+f(b,c)==1)+(f(C,A)+f(c,a)==1);
             if(sum == 3)
             {
             if(A>=B)
             {
               if(B>=C)
               cout << "ABC";
               else if(A>=C)
               cout << "ACB";
               else
               cout << "CAB";
             }
             else
             {
               if(A>=C)
               cout << "BCA";
               else if(B>=C)
               cout << "BAC";
               else
               cout << "CBA";
               }
             g=1;
             break;
             }
          }
       if(g==1)
       {
         s=1;
         break;
       }
       }
       if(s==1)
       break;
    }
    return 0;
}
/*
 *  appetite.cpp
 *  Author: ???
 *  Created on: 2012-10-23
 *  function????
 */
int main()
{
	int A,As,B,Bs,C,Cs,i;//????
	char app[4][2];//???????
	for(A=1;A<=3;A++)//????
		for(B=1;B<=3;B++)
		{
			if(A==B)continue;
			for(C=1;C<=3;C++)
			{
				if(A==C||B==C)continue;//???????????????????????????
				As=(A<B)+(A==C);//A???
				Bs=(A>B)+(A>C);//B???
				Cs=(B<C)+(B>A);//C???
				if(As+A==3&&Bs+B==3&&Cs+C==3)//?????????????????
				{
					strcpy(app[A],"A");//????A?app[A]
					strcpy(app[B],"B");//????B?app[B]
					strcpy(app[C],"C");//????C?app[C]
					for(i=1;i<=3;i++)//?????????
						cout<<app[i];
				}
		    }
		}
	return 0;//????
}
int A, B, C, i, j, word[3];
char man[3];
int main()
{
	for(A = 0; A < 3; A++)
	for(B = 0; B < 3; B++)
	for(C = 0; C < 3; C++)
	{
		if(A != B && B != C && C != A)
		{
			word[A] = (B > A) + (A == C);
			word[B] = (A > B) + (A > C);
			word[C] = (C > B) + (B > A);
			man[A] = 'A';
			man[B] = 'B';
			man[C] = 'C';
			if(word[0] > word[1] > word[2])		
			{cout << man[0] << man[1] << man[2] << endl;}
		}
	}
	return 0;
}
//****************************************
//*??????                         **
//*?????? 1100012798              **
//*???2011.10.15                     **
//****************************************
int main()
{
    int a,b,c,ai,bi,ci;                            // ??a,b,c,ai,bi,ci???
    char k[3];                                     // ??k[3]?????
    for (a = 0;a < 3;a++)                          // ????,???a,b,c?????
    {
        for (b = 0;b < 3;b++)
        {
            for (c = 0;c < 3;c++)
            {
                ai = 0;
                bi = 0;
                ci = 0;                            // ??????
                if (b > a)
                    ai++;
                if (c == a)
                    ai++;
                if (b < a)
                    bi++;
                if (c < a)
                    bi++;
                if (c > b)
                    ci++;
                if (b > a)
                    ci++;                          // ????????????
                if ((a + ai == 2) && (b + bi == 2) && (c + ci == 2))
                {
                    k[a] = 'A';
                    k[b] = 'B';
                    k[c] = 'C';
                    cout<<k[0]<<k[1]<<k[2]<<endl;  // ?????????A,B,C
                }
            }
        }
    }
    return 0;
}
//****************************************
//*??????                         **
//*????? 1100012780     	        **
//*???2011.10.16                     **
//****************************************
int main()
{
	int A,B,C,a,b,c;//A,B,C?????ABC?????????????abc?????????
	for (a = 0;a <= 2;a++)
	{
		if (a == 0)//A???a?????
			continue;
		for (b = 0;b <= 2;b++)
		{
			if (b == a)//b????a?????
				continue;
			for (c = 0;c <= 2;c++)
			{
				A = (b > a);
				B = (a > b) + (a > c);
				C = (c > b) + (b > a);
				if ((b == a) || (b == c) || (a == c))
					continue;
				if ((a + A == 2) && (b + B == 2) && (c + C == 2))
				{
					if (a == 2)
					{
						if (b == 1)
							cout<<"CBA";
						if (b == 0)
							cout<<"BCA";
					}
					if (a == 1)
					{
						if (b == 0)
							cout<<"BAC";
						if (b == 2)
							cout<<"CAB";
					}
				}
			}
		}
	}
	return 0;
}
//  ???
//  ??? 1100012820
//  20111012
//*******************
int main()
{
	int a, b, c, d;
	int cc1, cc2, cc3;
	for (a = 1; a <= 3; a++)
	{
		for (b = 1; b <= 3; b++)
		{
			for (c = 1; c <= 3; c++)
			{
				cc1 = (b > a) + (c == a);
				cc2 = (a > b) + (a > c);
				cc3 = (c > b) + (b > a);
				if (((a + cc1) == 3) && ((b + cc2) == 3) && ((c + cc3) == 3))
				{
					if (a == 3)
					{
						if (b == 2)
							cout << "CBA" << endl;
						else
							cout << "BCA" << endl;
					}
					if (b == 3)
					{
						if (a == 2)
							cout << "CAB" << endl;
						else
							cout << "ACB" << endl;
					}
					if (c == 3)
					{
						if (b == 2)
							cout << "ABC" << endl;
						else
							cout << "BAC" << endl;
					}
				}
			}
		}
	}
	return 0;
}
/*
 *???????.cpp
 *?????
 *????: 2012-10-17
 *?????????????????????????
 */


int main(){
	int Aapp,Bapp,Capp,i;					//??A?B?C??????Aapp,Bapp,Capp?????i
	int Aw,Bw,Cw;							//??A?B?C?????Aw,Bw,Cw
    for (Aapp=1;Aapp<=3;Aapp++)				//?Aapp???1?3??
    {
    	for(Bapp=1;Bapp<=3;Bapp++)			//?Bapp???1?3??
    	{
    		for(Capp=1;Capp<=3;Capp++)		//?Capp???1?3??
    		{
    			Aw=(Bapp>Aapp)+(Capp==Aapp);	//A???
    			Bw=(Aapp>Bapp)+(Aapp>Capp);		//B???
    			Cw=(Capp>Bapp)+(Bapp>Aapp);		//C???
    			if (3-Aapp==Aw&&3-Bapp==Bw&&3-Capp==Cw)			//?????????????
    			{
    				for(i=0;i<=3;i++)			//?????3??0
    				{
    					if(Aapp==i)				//?A??==i?
    						cout<<"A";	//??"A"
    					if(Bapp==i)   			//?B??==i?
    						cout<<"B";	//??"B"
    					if(Capp==i)				//?C??==i?
    						cout<<"C";	//??"C"
    				}
    			}
       		}
    	}
    }
    return 0;									//????
}
int main(){
    int a,b,c,aa,bb,cc,i;
    char food[4];
    for(a=1;a<4;a++)
    	for(b=1;b<4;b++)
    		for(c=1;c<4;c++){
    			aa=((b>a)+(c==a));
    			    bb=((a>b)+(a>c));
    			    cc=((c>b)+(b>a));
                 if((((a==b)&&(aa==bb))+((a<b)&&(aa>bb))+((a>b)&&(aa<bb)))==1)
                	 if((((a==c)&&(aa==cc))+((a<c)&&(aa>cc))+((a>c)&&(aa<cc)))==1)
                		 if((((b==c)&&(bb==cc))+((b>c)&&(bb<cc))+((b<c)&&(bb>cc)))==1){
                			 food[a]='A';
                			 food[b]='B';
                			 food[c]='C';
                			for(i=1;i<4;i++)
                				cout<<food[i];
                			cout<<endl;
                		 }
                  }
return 0;
}
int sgn(int n)
{
	if(n>0)	return 1;
	if(n<0)	return -1;
	else    return 0;
}
int main()
{
	int a,b,c;
	int word[4];
	for(int a=1;a<=3;a++)
		for(int b=1;b<=3;b++)
			for(int c=1;c<=3;c++)
			{
				if(a!=1&&b!=1&&c!=1)	continue;
				if(a!=2&&b!=2&&c!=2&&!(a==1&&b==1&&c==1))	continue;
				word[1]=(b>a)+(c==a);
				word[2]=(a>b)+(a>c);
				word[3]=(c>b)+(b>a);
				if(sgn(word[1]-word[2])==-sgn(a-b)&&sgn(word[1]-word[3])==-sgn(a>c)&&sgn(word[3]-word[2])==-sgn(c>b))
				{
					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';
					cout<<endl;
				}
			}
	return 0;

}
//============================================================================
// Name        : c.cpp
// Author      : shaodian
// Version     :
// Copyright   : Your copyright notice
// Description :
//============================================================================


int main()
{
	int A,B,C;
	for(int a=1;a<=3;a++)//a???1????????
		 for(int b=1;b<=3;b++)//
			 for(int c=1;c<=3;c++)//??a,b,c??A,B,C??????
			 {A=(b>a)+(c==a);
			 B=(a>b)+(a>c);
			 C=(c>b)+(b>a);
			 if(A>B&&B>C&&a<b&&b<c){cout<<"ABC"<<endl;break;}
			 if(A>C&&A>B&&a<c&&C<b){cout<<"ACB"<<endl;break;}
			 if(B>A&&A>C&&b<a&&a<c){cout<<"BAC"<<endl;break;}
			 if(B>C&&C>A&&b<c&&c<a){cout<<"BCA"<<endl;break;}
			 if(C>A&&A>B&&c<a&&a<b){cout<<"CAB"<<endl;break;}
			 if(C>B&&B>A&&c<b&&b<a){cout<<"CBA"<<endl;break;}//?????????
			 }


	return 0;
}
int main()
{
	int a,b,c;
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			if(b!=a)
			{
				c=6-a-b;
				if((b>a)+(c==a)==3-a)
				{
					if((a>b)+(a>c)==3-b)
					{
						if((c>b)+(b>a)==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;
}
int check_assertions_a(int i, int j, int k)
{
    int correct = 0;
    if (j < i) {
        correct += 1;
    }
    if (k == i) {
        correct += 1;
    }
    return correct;
}

int check_assertions_b(int i, int j, int k)
{
    int correct = 0;
    if (i < j) {
        correct += 1;
    }
    if (i < k) {
        correct += 1;
    }
    return correct;
}

int check_assertions_c(int i, int j, int k)
{
    int correct = 0;
    if (k < j) {
        correct += 1;
    }
    if (j < i) {
        correct += 1;
    }
    return correct;
}

int main()
{
    int i, j, k;
    int array[3] = {1, 2, 3};
    for (i = 0; i < 3; i++) {
        for (j = 0; j < 3; j++) {
            for (k = 0; k < 3; k++) {
                if (i == j || i == k || j == k) {
                    continue;
                }
                if (check_assertions_a(i, j, k) == i &&
                    check_assertions_b(i, j, k) == j &&
                    check_assertions_c(i, j, k) == k) {
                    printf("%c%c%c", k+'A', j+'A', i+'A');
                }
            }
        }
    }
    return 0;
}
int main(){
int a,b,c;
for(int i=0;i<3;i++){						//for?????????????// 
for(int j=0;j<3;j++){
for(int k=0;k<3;k++){
a=(j>i)+(i==k)==2-i;
b=(i>j)+(i>k)==2-j;
c=(k>j)+(j>i)==2-k;
if(a&&b&&c)									//???????????// 
{
int d[3]={i,j,k},p;
char f[3]={'A','B','C'},q;
for(int x=0;x<2;x++){
for(int y=0;y<2-x;y++){
if(d[y]>d[y+1]){
p=d[y];
d[y]=d[y+1];
d[y+1]=p;
q=f[y];
f[y]=f[y+1];								//??// 
f[y+1]=q;
}
}
}
cout<<f[0]<<f[1]<<f[2]; 				
}
}
}
}

return 0;
}