semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//???
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 (a==1)
					if (b<=a||c!=a)
						continue;
				if (a==2)
					if ((b>a&&c==a)||(b<=a&&c!=a))
						continue;
				if (a==3)
					if (b>a||c==a)
						continue;
				if (b==1)
					if (a<=b||a<=c)
						continue;
				if (b==2)
					if ((a<=b&&a<=c)||(a>b&&a>c))
						continue;
				if (b==3)
					if (a>b||a>c)
						continue;
				if (c==1)
					if (c<=b||c<=a)
						continue;
				if (c==2)
					if ((c<=b&&c<=a)||c>b&&c>a)
						continue;
				if (c==3)
					if (c>b||c>a)
						continue;
				if (a==1&&b==2&&c==3)//????????
					cout<<"ABC"<<endl;
				if (a==1&&b==3&&c==2)
					cout<<"ACB"<<endl;
				if (a==2&&b==1&&c==3)
					cout<<"BAC"<<endl;
				if (a==2&&b==3&&c==1)
					cout<<"CAB"<<endl;
				if (a==3&&b==1&&c==2)
					cout<<"BCA"<<endl;
				if (a==3&&b==2&&c==1)
					cout<<"CBA"<<endl;
				break;
			}
		}
	}
	return 0;
}
int main()
{
	int a1=0,b1=0,c1=0;//?????????????????
	int a,b,c;//??????????????
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
			for(c=0;c<=2;c++)
			{
				a1=((a<b)+(a==c));//?????????????
				b1=((b<a)+(a>c));
				c1=((c>b)+(b>a));
				if(a>b&&b>c&&c1>b1&&b1>a1)cout<<"C"<<"B"<<"A"<<endl;//???????
				if(a>c&&c>b&&b1>c1&&c1>a1)cout<<"B"<<"C"<<"A"<<endl;
				if(b>a&&a>c&&c1>a1&&a1>b1)cout<<"C"<<"A"<<"B"<<endl;
				if(b>c&&c>a&&a1>c1&&c1>b1)cout<<"A"<<"C"<<"B"<<endl;
				if(c>a&&a>b&&b1>a1&&a1>c1)cout<<"B"<<"A"<<"C"<<endl;
				if(c>b&&b>a&&a1>b1&&b1>c1)cout<<"A"<<"B"<<"C"<<endl;
			}
	return 0;
}
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;
				int i,j,k;
				i=((B>A)+(C==A));
				j=((A>B)+(A>C));
				k=((C>B)+(B>A));
				if(A+i==3&&B+j==3&&C+k==3)
				{
					for(i=1;i<=3;i++)
					{
						if(A==i)
							cout<<"A";
						if(B==i)
							cout<<"B";
						if(C==i)
							cout<<"C";
					}
				}
			}
		}
	}
	return 0;
}
/*
 * bifanliang.cpp
 *
 *  Created on: 2012-10-26
 *      Author: 99006
 */

int main (){
	int a,b,c;
	int ia(int,int,int);
	int ib(int,int,int);
	int ic(int,int,int);
	void out(int,int,int);
	for (a=0;a<=2;a++)
		for (b=0;b<=2;b++){
			if (a==b) continue;
			c=3-a-b;
			if (a+ia(a,b,c)==2&&b+ib(a,b,c)==2&&c+ic(a,b,c)==2)
				out(a,b,c);

		}
	return 0;
}
int ia (int a,int b,int c){
	int i=0;
	if (b>a) i++;
	if (c==a) i++;
	return i;
}
int ib (int a,int b,int c){
	int i=0;
	if (a>b) i++;
	if (a>c) i++;
	return i;
}
int ic (int a,int b,int c){
	int i=0;
	if (c>b) i++;
	if (b>a) i++;
	return i;
}
void out (int a,int b,int c){
	for (int i=0;i<=2;i++){
		if (a==i) cout<<"A";
		else if (b==i) cout<<"B";
			 else cout<<"C";
	}
}
int main()
{
	int a,b,c,num1,num2,num3,i; char h[3];
	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)
					{
						num1=(b>a)+(c==a);//??????????
						num2=(a>b)+(a>c);
						num3=(c>b)+(b>a);
						if((num1-num2)*(b-a)>0&&(num1-num3)*(c-a)>0&&(num2-num3)*(c-b)>0)//???????????
						{
							h[num1]='A'; h[num2]='B';h[num3]='C';//???????????
							for(i=2;i>=0;i--)
								cout<<h[i];
						}
					}
	return 0;
}
int main()
{
	int a,b,c;//??
	int aw,bw,cw;//?????
	char a1,b1,c1;//??????
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)//??
			{
				aw=(b>a)+(c==a);
				bw=(a>b)+(a>c);
				cw=(c>b)+(b>a);//?????
				if
					(!(a<=b&&aw<=bw||a<=c&&aw<=cw||
					b<=a&&bw<=aw||b<=c&&bw<=cw||
					c<=a&&cw<=aw||c<=b&&cw<=bw))//????????????????????
				{
					a1=a;
					b1=b;
					c1=c;//????
					//cout<<a<<b<<c<<endl;
				}
			}
		}
	}
	char r[4];
	r[a1]='A';
	r[b1]='B';
	r[c1]='C';
	for(int j=1;j<=3;j++)
	cout<<r[j];
	return 0;
}
/*
 * bifanliang.cpp
 *
 *  Created on: 2010-11-17
 *      Author: Administrator
 *      ???????
 */
int main() {
	int A, B, C, As, Bs, Cs;
	for (A = 0; A <= 2; A++)
		for (B = 0; B <= 2; B++)
			for (C = 0; C <= 2; C++) {

				As = (B > A) + (A == C);
				Bs = (A > B) + (A > C);
				Cs = (C > B) + (B > A);
				if ((A + As == 2) && (B + Bs == 2) && (C + Cs == 2)) {
					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 < B) && (B < A))
						cout << "CBA" << endl;
					else if ((C < A) && (A < B))
						cout << "CAB" << endl;
				}
			}
	return 0;
}
//============================================================================
// Name        : 1.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++
//============================================================================


int main()
{
    int a=0,b=0,c=0,i=0,p=0,q=0;
    for(i=1;i<=3;i=i+1)
    	{
    	  a=a+1;
    	 for(p=1;p<=3;p=p+1)
    	 {
    		 b=b+1;
    		 for(q=1;q<=3;q=q+1)
    		 {
    			 c=c+1;
    			 if(((b>a)+(c==a)+(a>b)+(a>c)+(c>b)+(b>a))==3)
    			 {
    				 if((a>b)&&(b>c))
    				 {
    					 cout<<"ABC"<<endl;
    					 return 0;
    				 }
    				 else if((a>c)&&(c>b))
    				 {
    					 cout<<"ACB"<<endl;
    					 return 0;
    				 }
    				 else if((b>c)&&(c>a))
    				 {
    					 cout<<"BCA"<<endl;
    					 return 0;
    				 }
    				 else if((b>a)&&(a>c))
    				 {
    					 cout<<"BAC"<<endl;
    					 return 0;
    				 }
    				 else if((c>b)&&(b>a))
    				 {
    					 cout<<"BCA";
    					 return 0;

    				 }
    				 else if((c>a)&&(a>b))
    				 {
    					 cout<<"CAB";
    					 return 0;
    				 }

    			 }
    		 }
    	 }

    	}
    return 0;

}
int main()
{
	int a,b,c,a1,b1,c1,a2,b2,c2,sum1,sum2,sum3,find;
	for(a=0;a<=2;a++)
	{if(find==1)
			{break;}
		for(b=0;b<=2;b++)
		{if(find==1)
			{break;}
			for(c=0;c<=2;c++)
			{
				
                a1=b>a;
				a2=a==c;
				b1=a>b;
				b2=a>c;
				c1=c>b;
				c2=b>a;
               sum1=a1+a2;
			   sum2=b1+b2;
			   sum3=c1+c2;
			   
				   if(a>=b&&a>=c&&b>=c&&sum1<=sum2&&sum1<=sum3&&sum2<=sum3)
				   {
					   cout<<"ABC",find=1;break;
				   }
				   else if(a>=c&&a>=b&&c>=b&&sum1<=sum3&&sum1<=sum2&&sum3<=sum2)
				   {
					   cout<<"ACB",find=1;break;
                   }
				   else if(b>=c&&b>=a&&a>=c&&sum2<=sum3&&sum2<=sum1&&sum1<=sum3)
				   {
					   cout<<"BAC",find=1;break;
                   }
				   else if(b>=c&&b>=a&&c>=a&&sum2<=sum3&&sum2<=sum1&&sum3<=sum1)
				   {
					   cout<<"BCA",find=1;break;
                   }
				   else if(c>=a&&c>=b&&a>=b&&sum3<=sum1&&sum3<=sum2&&sum1<=sum2)
				   {
					   cout<<"CAB",find=1;break;
                   }
				   else if(c>=a&&c>b&&b>=a&&sum3<=sum1&&sum3<sum2&&sum2<=sum1)
				   {
					   cout<<"CBA",find=1;break;
                   }
			   
			}
		}
	}
 

     
				
				
				
				
				
				return 0;
}
int main()
{
	int a, b, c, o, p, q;			//??????
	a=3; b=2; c=1;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o<p)&&(p<q))
	{
		cout << "ABC" << endl;
		return 0;
	}
	a=3; c=2; b=1;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o<p)&&(p<q))
	{
		cout << "ACB" << endl;
		return 0;
	}
	a=3; b=2; c=2;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o<p)&&(p==q))
	{
		cout << "ABC" << endl;
		return 0;
	}
	a=3; b=3; c=1;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o==p)&&(p<q))
	{
		cout << "ABC" << endl;
		return 0;
	}
	a=3; b=2; c=3;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o==q)&&(p>q))
	{
		cout << "ACB" << endl;
		return 0;
	}
	a=3; b=3; c=3;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o==p)&&(p==q))
	{
		cout << "ABC" << endl;
		return 0;
	}
	a=2; b=3; c=1;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o>p)&&(o<q))
	{
		cout << "BAC" << endl;
		return 0;
	}
	a=1; b=3; c=2;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o>=q)&&(p<=q))
	{
		cout << "BCA" << endl;
		return 0;
	}
	a=1; b=2; c=1;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o==q)&&(p<q))
	{
		cout << "BAC" << endl;
		return 0;
	}
	a=1; b=2; c=2;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o>p)&&(p==q))
	{
		cout << "BCA" << endl;
		return 0;
	}
	a=2; b=1; c=3;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o<p)&&(o>q))
	{
		cout << "CAB" << endl;
		return 0;
	}
	a=1; b=2; c=3;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o>p)&&(p>q))
	{
		cout << "CBA" << endl;
		return 0;
	}
	a=2; b=2; c=3;
	o=(b>a)+(a==c);
	p=(a>b)+(a>c);
	q=(c>b)+(b>a);
	if ((o==p)&&(p>q))
	{
		cout << "CAB" << endl;
		return 0;
	}
}
//???


int main()
{
    int a, b, c, righta, rightb, rightc;
    char fir , sec , thi;
    for(a = 1 ; a <= 3 ; a++)
    {
        for(b = 1 ; b <= 3 ; b++)
        {
            for(c = 1 ; c <= 3 ; c++)
            {
                righta = (b < a) + (c == a);
                rightb = (a < b) + (a < c);
                rightc = (c < b) + (b < a);
                if(((a < b && righta < rightb) || (a == b && righta == rightb) || (a > b && righta > rightb))
                   && ((c < b && rightc < rightb) || (c == b && rightc == rightb) || (c > b && rightc > rightb))
                   && ((a < c && righta < rightc) || (a == c && righta == rightc) || (a > c && righta > rightc)))
                   {
                       if (a == 1)
                           fir = 'A';
                       if (b == 1)
                           fir = 'B';
                       if (c == 1)
                           fir = 'C';
                       if (a == 2)
                           sec = 'A';
                       if (b == 2)
                           sec = 'B';
                       if (c == 2)
                           sec = 'C';
                       if (a == 3)
                           thi = 'A';
                       if (b == 3)
                           thi = 'B';
                       if (c == 3)
                           thi = 'C';
                       cout<<thi<<sec<<fir<<endl;
                   }
            }
        }
    }
    return 0;
}
int main()
{


	int A,B,C,d,e;
	for(A=0;A<=2;A++)
		for(B=0;B<=2;B++)
			for(C=0;C<=2;C++)
			{
				if((A!=B)&&(A!=C)&&(B!=C))
				{
					if(A>B&&B>C&&(B>A||A==C)==0&&C>B&&B>A==1&&((A>B&&A>C)+(A>B||A>C))==1)
					{
						cout<<"C"<<"B"<<"A"<<endl;
					}
					if(A>C&&C>B&&(B>A||A==C)==0&&(A>B&&A>C)==1&&((C>B&&B>A)+(C>B||B>A))==1)
					{
						cout<<"B"<<"C"<<"A"<<endl;
					}
					if(B>A&&A>C&&(B>A||A==C)==0&&(C>B&&B>A)==1&&((B>A&&A==C)+(B>A||A==C))==1)
					{
						cout<<"C"<<"A"<<"B"<<endl;
					}
					if(B>C&&C>A&&(B>A||A==C)==0&&(B>A&&A==C)==1&&((C>B&&B>A)+(C>B||B>A))==1)
					{
						cout<<"A"<<"C"<<"B"<<endl;
					}
					if(C>A&&A>B&&(C>B||B>A)==0&&(A>B&&A>C)==1&&((B>A&&A==C)+(B>A||A==C))==1)
					{
						cout<<"B"<<"A"<<"C"<<endl;
					}
					if(C>B&&B>A&&(C>B||B>A)==0&&(B>A&&A==C)==1&&((A>B&&A>C)+(A>B||A>C))==1)
					{
						cout<<"A"<<"B"<<"C"<<endl;
					}
				}

			}













	return 0;
}
int main()
{
	int A,B,C,i;//????,i???????
	char words[3],rank[3];//????????????????????????
	for(A=0;A<=2;A++)//?? ????
	{
		for(B=0;B<=2;B++)
		{
			if(B==A)continue;//??????
			for(C=0;C<=2;C++)
			{
				if(C==A||C==B)continue;
				words[0]=(B>A)+(C==A);//????????
				words[1]=(A>B)+(A>C);
				words[2]=(C>B)+(B>A);
				rank[A]=0;
				rank[B]=1;
				rank[C]=2;
				if((A+words[rank[A]])==2&&(B+words[rank[B]])==2&&(C+words[rank[C]])==2)//????????
					for(i=0;i<=2;i++)//??
						cout<<(char)(rank[i]+65);//???????
			}
		}
	}
	return 0;//??0
}
//**********************
//********???********
//*??:?? 1100012915*
//******??:10.12******
//**********************
int main()
{
	int a,b,c,at,bt,ct,shunxu1,shunxu2;//a?b?c?A?B?C???
	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)
					{
						at = (b > a)+(c == a);//at,bt,ct?A?B?C?????
						bt = (a > b)+(a > c);
						ct = (c > b)+(b > a);
						shunxu1 = a * 100 + b * 10 + c;//???????????????????????????
						shunxu2 = at *100 + bt * 10 + ct;
						if (shunxu1 + shunxu2 == 333)//???????????
							switch(shunxu1)//switch?if????...
						{
							case 123 :cout << "ABC";break;//123??A???1?B?2?C?3???????????ABC
							case 132 :cout << "ACB";break;
							case 213 :cout << "BAC";break;
							case 231 :cout << "CAB";break;
							case 312 :cout << "BCA";break;
							default :cout << "CBA";
							}
					}
				}
			}
		}
	}
	return 0;
}
//============================================================================
// Name        : shj.cpp
// Author      : ???
// Time        : 2013.12.07
// Description : ???
//============================================================================
int main(){
	int a=0,b=0,c=0;
	int x=0,y=0,z=0;
	for(a=0;a<3;a++)
		for(b=0;b<3;b++)
			for(c=0;c<3;c++){
				if(a==b||a==c||b==c)continue;
				else{
				   x=(b>a)+(c>a);//a???????
				   y=(a>b)+(a>c);//b???????
				   z=(c>b)+(b>a);//c???????
				   if(b>a&&a>c&&z>x&&x>y)
				   	   cout<<"B"<<"A"<<"C"<<endl;//????
				   if(b>c&&c>a&&x>z&&z>y)
				   	   cout<<"B"<<"C"<<"A"<<endl;//????
				   if(c>b&&b>a&&x>y&&y>z)
				   	   cout<<"C"<<"B"<<"A"<<endl;//????
				   if(c>a&&a>b&&y>x&&x>z)
				   	   cout<<"C"<<"A"<<"B"<<endl;//????
				}
			}
  return 0;
}
int main(void)
{
    int a , b , c, a1, b1, c1, i;
    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);
            if((a+a1)==(b+b1)&&(a+a1)==(c+c1))
            {
                for(i=1;i<=3;i++){
                if(a==i)
                printf("A");
                if(b==i)
                printf("B");
                if(c==i)
                printf("C");}



            }
            }

        }
    }
    return 0;
}
int main()
{
  int a,b,c;                  //??A`B`C????a`b`c,???0-2
  char S[3];                  //??????S???
  for (a=0;a<3;a++)           //????a`b`c??
  {
    for (b=0;b<3;b++)
    {
      for (c=0;c<3;c++)
      { 
        int x=2,y=2,z=2;      //??????A`B`C?????
        if (b>a)              //???????,???????,???????????1
        {
          x=x-1;
          z=z-1;
        }
        if (a==c)
          x=x-1;
        if (b<a)
          y=y-1;
        if (a>c)
          y=y-1;
        if (c>b)
          z=z-1;    
        if (a==x&&b==y&&c==z) //???????????????
        {
           S[a]='A';          //???????????A`B`C??S[3]
           S[b]='B';
	   S[c]='C';
        }
      }
    }  
  } 
  cout<<S[0]<<S[1]<<S[2];     //????????????A`B`C
  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)+a==3)&&((a>b)+(a>c)+b==3)&&((c>b)+(b>a)+c==3))
					{if((a<b)&&(a<c))
						{cout<<'A';
						if(b<c)cout<<'B'<<'C';
						else cout<<'C'<<'B';
						}
					else if((b<c)&&(b<a))
						{cout<<'B';
						if(a<c)cout<<'A'<<'C';
						else cout<<'C'<<'A';
						}
					else {cout<<'C';
					     if(a<b)cout<<'A'<<'B';
					     else cout<<'B'<<'A';
					     }
					}
				}
			}
		}
}
int main ()
{
	int A,B,C,sent[5],i;
	char b[5];
	for (A=1;A<4;A++)
	{
		for (B=1;B<4;B++)
		{
			if (A==B)
				continue;
			for (C=1;C<4;C++)
			{
				if (A==C||B==C)
					continue;
				else
				{
					b[A]='A';
					b[B]='B';
					b[C]='C';
					sent[A]=(B>A)+(C==A);
					sent[B]=(A>B)+(A>C);
					sent[C]=(C>B)+(B>A);
					for (i=1;i<4;i++)
					{
						if (sent[i]!=(3-i))
							break;
						else if (i==3) 
							cout<<b[1]<<b[2]<<b[3]<<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a[3],b[3],i,j,flag,min;
	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]++)
			{
				b[0]=(a[1]>a[0])+(a[0]==a[2]);
				b[1]=(a[0]>a[1])+(a[0]>a[2]);
				b[2]=(a[2]>a[1])+(a[1]>a[0]);
				flag=1;
				for(i=0;i<2;i++)
					for(j=i+1;j<3;j++)
					{
						if(a[i]<a[j]&&b[i]<b[j]||a[i]>a[j]&&b[i]>b[j]||a[i]==a[j]&&b[i]!=b[j]||a[i]!=a[j]&&b[i]==b[j])
						{
							flag=0;
							break;
						}
						if(flag==0)break;
					}
				if(flag)
				{
					for(i=0;i<3;i++)
					{
						min=0;
						for(j=0;j<3;j++)
							if(a[min]>a[j])min=j;
						cout<<(char)(min+65);
						a[min]=32767;
					}
					return 0;
				}
			}
	return 0;
}
int main()
/*3?????????????? 
A??B??????C??????? 
B??A??????A??C??? 
C????B????B?A???? 
????????????????????? 
???????????3?????*/
{
	int a,b,c;		//three persons
	int rank[4];
	int i,j;
	int ta,tb,tc;	//true sentence everyone said
	for (a=1;a<=3;a++)
		for (b=1;b<=3;b++)
		{
			if (a==b)   continue;
			for (c=1;c<=3;c++)
			{
				if (  (c==a)||(c==b)  )		continue;
				ta=(b>a)+(c==a);
				tb=(a>b)+(a>c);
				tc=(c>b)+(b>a);
				if ((a+ta)==3)
					if ((b+tb)==3)
						if ((c+tc)==3)
						{
							rank[1]=a;
							rank[2]=b;
							rank[3]=c;
							for (i=1;i<=3;i++)
								for (j=1;j<=3;j++)
								if (rank[j]==i)		cout <<(char)(64+j);
						}
			}
		}
	return 0;
}
int main(void)
{
	int a_judge, b_judge, c_judge; //A,B,C?????????????
	int a, b, c; //A,B,C??????????
	char pname[3] = {'A', 'B' ,'C'}; //ABC???????????


	for(a = 0; a < 3; a++) //0?1?2????
		for(b = 0; b < 3; b++)
			for(c = 0; c < 3; c++)
			{
				a_judge = (b > a) + (c == a);
				b_judge = (a > b) + (a > c);
				c_judge = (c > b) + (b > a);

				if (((2 - a) == a_judge) && 
					((2 - b) == b_judge) &&
					((2 - c) == c_judge))       //A,B,C????????????
				{
					if (a > b)
					{
						if (b > c)
							cout <<"CBA"<< endl;
						else 
							if(a > c)
								cout <<"BCA"<< endl;
							else
								cout <<"BAC"<< endl;
					}
					else
					{
						if (a > c)
							cout <<"CAB"<< endl;
						else 
							if (b > c)
								cout <<"ACB"<< endl;
							else 
								cout <<"ABC"<< endl;
					}
				}   
			}

			return 0;
}
int main(){
	int a, b, c;
	int ra, rb, rc;
	char res[4];

	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;
				ra = rb = rc = 0;

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

				if ((a > b && ra > rb)
					|| (a > c && ra > rc)
					|| (b > c && rb > rc))
					continue;

				res[a] = 'A';
				res[b] = 'B';
				res[c] = 'C';
				res[3] = '\0';
			}
		}
	cout << res << endl;
	return 0;
}
//*****************************
//*???
//******************************
int main()
{
	int A,B,C;
	int sumA,sumB,sumC;
	sumA=(B>A)+(C==A);
	sumB=(A>B)+(A>C);
	sumC=(C>B)+(B>A);
	if(A>B&&B>C&&sumA<sumB&&sumB<sumC)
		cout<<"CBA"<<endl;
	if(A>C&&C>B&&sumA<sumC&&sumC<sumB)
		cout<<"BCA"<<endl;
	if(B>A&&A>C&&sumB<sumA&&sumA<sumC)
		cout<<"CAB"<<endl;
	if(B>C&&C>A&&sumB<sumC&&sumC<sumA)
		cout<<"ACB"<<endl;
	if(C>A&&A>B&&sumC<sumA&&sumA<sumB)
		cout<<"BAC"<<endl;
	if(C>B&&B>A&&sumC<sumB&&sumB<sumA)
		cout<<"ABC"<<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)==A-1&&(A<=B)+(A<=C)==B-1&&(C<=B)+(B<=A)==C-1)
			{  
				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 x[3],A,B,C,i;//???????????????
	for(A=1;A<=3;A++)//???????
    {for(B=1;B<=3;B++)
	{ for(C=1;C<=3;C++)
	{x[0]=(B>A)+(C==A);
	x[1]=(A>B)+(A>C);
	x[2]=(C>B)+(B>A);
    if ((x[0]>x[1])+(A>=B)==1&&(x[0]>x[2])+(A>=C)==1&&(x[1]>x[2])+(B>=C)==1)//?????????????????????????????????????????1
		for(i=1;i<=3;i++)//?????????
		{	if(A==i)  cout<<"A";
			if(B==i) cout<<"B";
			if(C==i) cout<<"C";}
	}
	}
	}
	return 0;
}
/*
 * homework9.cpp
 *
 *  Created on: 2012-10-11
 *      Author: wangyinzhi
 */

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)+(a==c));
					B=((a>b)+(a>c));
					C=((c>b)+(b>a));//????ABC??????
				if ((A>B>C)&&(c>b)&&(b>a)){
					cout<<"A"<<"B"<<"C";
				break;}
				if ((A>C>B)&&(b<c)&&(c<a)){
					cout<<"A"<<"C"<<"B";
					break;}
				if ((B>A>C)&&(b<a)&&(a<c)){
					cout<<"B"<<"A"<<"C";
					break;}
				if ((B>C>A)&&(b<c)&&(c<a)){
					cout<<"B"<<"C"<<"A";
					break;}
				if ((C>B>A)&&(c<b)&&(b<a)){
					cout<<"C"<<"B"<<"A";
					break;}
				if ((C>A>B)&&(c<a)&&(a<b)){
					cout<<"C"<<"A"<<"B";
					break;}//??????????????????????????




			}
		}
	}

		return 0;
                }
int main()
{
 int A,B,C;
 int a,b,c;
 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));
        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)
		{
			if (A<B)
			{
				if (A>C)
				{
					cout<<"C"<<"A"<<"B";
				}
				else 
				{
					if (B<C)
					{
						cout<<"A"<<"B"<<"C";
					}
					else
					{
						cout<<"A"<<"C"<<"B";
					}
				}
			}
			else 
			{
				if (B>C)
				{
					cout<<"C"<<"B"<<"A";
				}
			    else 
				{
					if (A<C)
					{
						cout<<"B"<<"A"<<"C";
					}
					else
					{
						cout<<"B"<<"C"<<"A";
					}
				}
			}
        
		}
   }
 return 0;
}
//***************************************************************************************
//*? ? ?:????.cpp                                                                *
//*?    ?:??? 1000012817                                                           *   
//*????:2010-11-12                                                                  *                                 
//*????:????,??????                                                       *
//***************************************************************************************
int main()						   //???
{
	int A,B,C,i;					   //???????A?B?C????3??????
	int num[4],rank[4];				   //?????????????????????????
	char name[4];//????????????
	for(A=1;A<=3;A++){//for?????????
		for(B=1;B<=3;B++){
			if(B==A) continue;
			C=6-B-A;
			num[1]=(B>A)+(C==A);
			num[2]=(A>B)+(A>C);
			num[3]=(C>B)+(B>A);		   //???????????????
			rank[A]=A;
			rank[B]=B;
			rank[C]=C;			   //????
			name[A]='A';
			name[B]='B';
			name[C]='C';			   //????
			if(num[1]+rank[A]==3
				&&num[2]+rank[B]==3
				&&num[3]+rank[C]==3)	   //??????????????
				for(i=1;i<=3;i++){
					cout<<name[i];//????
				}
		}
	}
	cout<<endl;
	return 0;
}							   //?????
int main()
{
    int A,B,C,shumu[4],i;
    char pai[4];
    for(i=1;i<=3;i++)shumu[i]=0;
    for(A=1;A<=3;A++) 
    {
                      for(B=1;B<=3;B++)
                      {
                                       if(A==B)continue;
                                       C=6-A-B;
                                       shumu[1]=(B>A)+(A==C);//A??????? 
                                       shumu[2]=(A>B)+(A>C);//B??????? 
                                       shumu[3]=(C>B)+(B>A);//C??????? 
                                                        if((shumu[1]+A)==(shumu[2]+B) && (shumu[2]+B)==(shumu[3]+C))//????????????????????????? 
                                                        {
                                                                                      pai[A]='A';
                                                                                      pai[B]='B';
                                                                                      pai[C]='C';
                                                        }
                      }
    }
    for(i=1;i<=3;i++)cout<<pai[i];
    return 0;
}
int main(){
int p=0,q=0,r=0;
for(p=0;p<=2;p=p+1)//?p q r ????A B C????????0?1?2?
{
 for(q=0;q<=2;q=q+1)
 {
for(r=0;r<=2;r=r+1)
{
if(p!=q&&q!=r&&r!=p)
{
if((2-p)==(p<q)+(r==p)&&(2-q)==(p>q)+(p>r)&&(2-r )==(r>q)+(q>p))//2-p,2-q,2-r?????ABC???????
{
if(p>q&&q>r)
{ cout<<"C"<<"B"<<"A";}
    else if(p>r&&r>q)
{ cout<<"B"<<"C"<<"A";}
else if(q>p&&p>r)
{ cout<<"C"<<"A"<<"B";}
else if(q>r&&r>p)
{ cout<<"A"<<"C"<<"B";}
else if(r>p&&p>q)
{ cout<<"B"<<"A"<<"C";}
else if(r>q&&q>p)
{ cout<<"A"<<"B"<<"C";}
}//??????????????????
}
}
 }
}
return 0;
}