semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int r[4], A, B, C, i, j;
	char a[4] = {'A','B','C','\0'};
	for(r[1] = 1; r[1] <= 3; r[1]++)
		for(r[2] = 1; r[2] <= 3; r[2]++)
			for(r[3] = 1; r[3] <= 3; r[3]++)
			{
				if(r[1] + r[2] + r[3] != 6 || r[1] * r[2] * r[3] != 6) continue;
				A = (r[2] > r[1]) + (r[3] == r[1]);
				B = (r[1] > r[2]) + (r[1] > r[3]);
				C = (r[3] > r[2]) + (r[2] > r[1]);
				if(r[1] + A == 3 && r[2] + B == 3 && r[3] + C == 3)
				{
					for(i = 1; i <= 3; i++)
					{
						for(j = 1; j <= 3; j++)
						{
							if(r[j] == i)
							{
								cout << a[j - 1];
								break;
							}
						}
					}
				}
			}
	return 0;
}
int main()
{
	int x,y,z;/*x?y?z????A?B?C?????*/
	int a,b,c;/*a?b?c????????????A?B?C?????*/
	int i;
	char rank[3];
	for(x=1;x<=2;x++)/*??x?y?z?????????*/
	for(y=0;y<=2;y++)
    for(z=0;z<=2;z++)
		if(x!=y&&x!=z&&y!=z)/*????????????if???????????*/
		{
			a=b=c=2;/*????2??????????????????????1*/
            if(x<y)
			{
				a--;
                c--;
			}
			else 
				b--;
			if(x>z)
				b--;
			if(y<z)
				c--;
			if(a!=b&&b!=c&&c!=a)
			{
				rank[a]='A';
				rank[b]='B';
				rank[c]='C';
				for(i=0;i<=2;i++)
				{
					cout<<rank[i];
				}

			}
		}
		return 0;
}
int main()
{
	int a,b,c,x,y,z;
	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
		{
			if(b==a) continue;
			c=6-a-b;
			x=(b>a)+(c==a);///////////////////?????????????????
	        y=(a>b)+(a>c);
            z=(c>b)+(b>a);
		    if( a+x==b+y&&b+y==c+z )
			{
				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,s1,s2,s3,shu[4];//????
	for(A=1;A<=3;A++)//????
		for(B=1;B<=3;B++)
			for(C=1;C<=3;C++)
			{
				s1=(B>A)+(A==C);
				s2=(A>B)+(A>C);
				s3=(C>B)+(B>A);
				if(A+s1==3&&B+s2==3&&C+s3==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;
	for(a=1;a<4;a++)
		for(b=1;b<4;b++)
			for(c=1;c<4;c++)
			{
				if((a+(b>a)+(c==a))==3&&(b+(a>b)+(a>c))==3&&(c+(c>b)+(b>a))==3)  //?????????????????????????
			goto loop;//???????????
			}
loop: if(a>b&&b>c)  //?????
		  cout<<"CBA";
	  else if(a>c&&c>b)
		  cout<<"BCA";
	  else if(c>b>a)
		  cout<<"ABC";
	  else if(c>a>b)
		  cout<<"BAC";
	  else if(b>a>c)
		  cout<<"CAB";
	  else if(b>c>a)
		  cout<<"ACB";
	  	  return 0;
}
int main()
{
int a,b,c,i;
for(a=0;a<3;a++)
{
for(b=0;b<3;b++)
{
 if(b==a)
	 continue;
 else 
 {
 c=3-a-b;
 if((b>a)+(c==a)+a==(a>b)+(a>c)+b&&(a>b)+(a>c)+b==(c>b)+(b>a)+c      )
 {
   for(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;
a=3;b=2;c=1;
if((b>a)+(a==c)==0&&(a>b)+(a>c)==1&&(c>b)+(b>a)==2)
cout<<"CBA"<<endl;
a=3;b=1;c=2;
if((b>a)+(a==c)==0&&(a>b)+(a>c)==2&&(c>b)+(b>a)==1)
cout<<"BCA"<<endl;
a=2;b=3;c=1;
if((b>a)+(a==c)==1&&(a>b)+(a>c)==0&&(c>b)+(b>a)==2)
cout<<"CAB"<<endl;
a=2;b=1;c=3;
if((b>a)+(a==c)==1&&(a>b)+(a>c)==2&&(c>b)+(b>a)==0)
cout<<"BAC"<<endl;
a=1;b=3;c=2;
if((b>a)+(a==c)==2&&(a>b)+(a>c)==0&&(c>b)+(b>a)==1)
cout<<"ACB"<<endl;
a=1;b=2;c=3;
if((b>a)+(a==c)==2&&(a>b)+(a>c)==1&&(c>b)+(b>a)==0)
cout<<"ABC"<<endl;
 return 0;

}
int main()
{
   int words[3],i,a,b,c;//words[3]???????????i?????a,b,c??????
   char rank[3];    //rank[3]????????????
   for(a=0;a<3;a++)  //?????????????
  {
       for(b=0;b<3;b++)
      {
           for(c=0;c<3;c++)
          {
           words[a]=(b>a)+(c==a);
           words[b]=(a>b)+(a>c);
           words[c]=(c>b)+(b>a);
           if(words[0]>words[1] && words[1]>words[2])
             {
              rank[a]='A';  //????????????????????
              rank[b]='B';
              rank[c]='C';
              for(i=0;i<3;i++)
              cout<<rank[i];//???????????????
              }   
          }   
  }     }
  return 0;
}
int main()
{
    int A,B,C;     //?A,B,C???? 
    int As,Bs,Cs;  //As,Bs,Cs???????? 
    char word[4];
    
    
    
    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))   //?????? 
          {
          word[A]='A';
          word[B]='B';
          word[C]='C';
          cout<<word[1]<<word[2]<<word[3];} //?????? 
          } 
          
return 0;
}
/*
 * bifanliang.cpp
 *
 *  Created on: 2013-10-14
 *      Author: ???1300012996
 */
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&&A>B&&B>C)cout<<"CBA"<<endl;
				if(a<c&&c<b&&A>C&&C>B)cout<<"BCA"<<endl;
				if(b<a&&a<c&&B>A&&A>C)cout<<"CAB"<<endl;
				if(b<c&&c<a&&B>C&&C>A)cout<<"ACB"<<endl;
				if(c<a&&a<b&&C>A&&A>B)cout<<"BAC"<<endl;
				if(c<b&&b<a&&C>B&&B>A)cout<<"ABC"<<endl;//??????????????
			}
		}
	}return 0;
}
int main()
{
    int a,b,c,m,n,p,i,j;
   
    for(a=1;a<=3;a++)
      for(b=1;b<=3;b++)
       if(b==a)
       continue;
       else
         for(c=1;c<=3;c++)
          if(c==a||c==b)
            continue;
          else
         {m=(a<b)+(a==c); 
          n=(a>b)+(a>c);
          p=(c>b)+(b>a);
          if(((a+m)==3)&&((b+n)==3)&&((c+p)==3))
         { int u[3]={a,b,c},x;
          char k[3]={'A','B','C'},y;
          for(i=0;i<=2;i++)
           for(j=0;j<=1;j++)
            if(u[j]>u[j+1])
             {x=u[j+1],u[j+1]=u[j],u[j]=x,
             y=k[j+1],k[j+1]=k[j],k[j]=y;}
             else continue;
          cout<<k[0]<<k[1]<<k[2];}
          else continue;}
         
     return 0;
     }
//**********************************************
//*      ???                                *
//*                      10.11.10 ???       *
//**********************************************

int main()
{
	int A,B,C;
	char rank[4];                                     //rank[1],rank[2],rank[3]???
	char word[4];                                     //word[1~3]?????
	for(A=1;A<=3;A++)
	{
		for(B=1;B<=3;B++)
		{
			if(A==B) continue;                // ??????a,b,c????
			C=6-A-B;
			word[A]=(B<A)+(C==A);             //a,b,c?????????????word[1~3]??????????
			rank[A]='A';                      //rank[1~3]??????
			word[B]=(A<B)+(A<C);           
			rank[B]='B';
			word[C]=(C<B)+(B<A);
			rank[C]='C';
			if(word[3]>word[2]&&word[2]>word[1])   //????????????????
				cout<<rank[3]<<rank[2]<<rank[1]<<endl;
		}
	}


	return 0;
}
int main()
{
	int eat[3],words[3],i,j,p,a[3]={0,1,2};
	char ch,name[3]={'A','B','C'};
	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;}
// ??? ?? 1000062708
int main()
{
	char d[4] = {'A','B','C'};
	int a, b, c, ta, tb, tc;
	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)
					{
						ta = (b > a) + (c == a);
						tb = (a > b) + (a > c);
						tc = (c > b) + (b > a);
						if((a + ta == 3) && (b + tb == 3) && (c + tc == 3)) 
							cout << d[3 - c] << d[3 - b] << d[3 - a] << endl;
					}
	return 0;
}
int main (void)
{
	int A,B,C, i; 
	int words;
	float word[4];
	char name[4];
	for (A= 1; A <= 3;A ++)
		for (B = 1;B <= 3;B ++)
			for ( C = 1;C <= 3; C++)
			{
				word[1] = A/10.0-(B > A)-(C == A);
				word[2] = B/10.0-(A > B)-(A > C);
				word[3] = C/10.0 - (C > B)-(B > A);
				if((A-B)*(word[1]-word[2])>0&&(C-B)*(word[3]-word[2])>0&&(A-C)*(word[1]-word[3])>0)
				{
					name[A] = 'A';
					name[B] = 'B';
					name[C] = 'C';
					for (i = 3; i > 0; i--)
						cout << name[i] ;
					cout << endl;
					return 0;
				}
			}


	return 0;
}
/*
 * ???.cpp
 *
 *  Created on: 2011-10-14
 *      Author: 1100012857
 */
int main(){
	char d[4];
	int a,b,c,i;
	for(a=0;a<=3;a++)
		for(b=0;b<=3;b++)
			for(c=0;c<=3;c++)//???
				if((b<=a)+(c!=a)==a-1)
						if((a<=b)+(a<=c)==b-1)
							if((c<=b)+(b<=a)==c-1){//????????????????
                                d[a]='A';
                                d[b]='B';
                                d[c]='C';
                                for(i=1;i<=3;i++)
                                {
                                	cout<<d[i];
                                }
							}
      return 0;

}
int main()
{
    int A, B, C, a, b, c;
	for (A = 0; A <= 2; A++)
	{
		for (B = 0; B <= 2; B++)
		{
            if (B == A)
				continue;
			else
			{
				C = 3 - B - A;
				a = (B > A);
				b = (A > B) + (A > C);
				c = (C > B) + (B > A);
				if ((a == (2 - A)) && (b == (2 - B)) && (c == (2 - C)))
				{
					if (A < B && A < C)
					{
						cout << "A";
						if (B < C)
						    cout << "B" << "C";
						else
							cout << "C" << "B";
                    }
					if (B < A && B < C)
					{
						cout << "B";
						if (A < C)
						    cout << "A" << "C";
						else
							cout << "C" << "A";
                    }
					if (C < B && C < A)
					{
						cout << "C";
						if (B < A)
						    cout << "B" << "A";
						else
							cout << "A" << "B";
                    }
				}
			}
		}
	}
	return 0;
}
int main()
{
    int a,b,c;
    
    
    char p0;
    char p[3]={'A','B','C'};
    for(int i=1;i<=3;i++)
    {
        for(int j=1;j<=3;j++)
        {
            for(int k=1;k<=3;k++)
            {
                int q1=0,q2=0,q3=0;
                a=(j>i)+(k==i);
                b=(i>j)+(i>k);
                c=(k>j)+(j>i);
                if((a-b)*(i-j)<0||((a-b)==0&&(i-j)==0))
                q1=1;
                if((a-c)*(i-k)<0||((a-c)==0&&(i-k)==0))
                q2=1;
                if((c-b)*(k-j)<0||((c-b)==0&&(k-j)==0))
                q3=1;
                if(q1==1&&q2==1&&q3==1)
                {
                    int m[3]={i,j,k},m0;
                  for(int s=0;s<3;s++)
                  {
                        for(int t=s+1;t<3;t++)
                        {
                            if(m[t]<m[s])
                            {
                                m0=m[t];
                                m[t]=m[s];
                                m[s]=m0;
                                p0=p[t];
                                p[t]=p[s];
                                p[s]=p0;
                            } 
                        }
                    }
                    cout<<p[0]<<p[1]<<p[2]<<endl;
                }
                
            }
        }
    }
    
    return 0;
}
/*
 * 70.cpp
 * ???
 *  Created on: 2012-9-16
 *      Author: Salforever
 */



int main(void)
{
	int A, B, C;
	int As, Bs, Cs;
	int AnsA, AnsB, AnsC;									//????
	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+As==3)&&(B+Bs==3)&&(C+Cs==3))	//????????
				{
					AnsA=A;
					AnsB=B;
					AnsC=C;
				}
			}
	if (AnsA<=AnsB && AnsB<=AnsC)
		cout << "ABC" << endl;
	if (AnsA<=AnsC && AnsC<=AnsB)
		cout << "ACB" << endl;
	if (AnsB<=AnsA && AnsA<=AnsC)
		cout << "BAC" << endl;
	if (AnsB<=AnsC && AnsC<=AnsA)
		cout << "BCA" << endl;
	if (AnsC<=AnsA && AnsA<=AnsB)
		cout << "CAB" << endl;
	if (AnsC<=AnsB && AnsB<=AnsA)
		cout << "CBA" << endl;								//????
	return 0;												//????
}
int main ()
{
    int a,b,c;//??
    char ans[3];
    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)
                 continue;
                 if (b==c)
                 continue;
                 if ((((b>a)+(0))==(3-a))&&(((a>b)+(a>c))==(3-b))&&(((c>b)+(b>a))==(3-c)))
                 {
                    ans[3-a]='A';
                    ans[3-b]='B';
                    ans[3-c]='C';
                 }
             }
         }
    }
    cout <<ans[2]<<ans[1]<<ans[0];//??
    return 0;
}
int main ()
{
    int A , B , C ; 
    A = 2 , B = 1 , C = 0 ;
    if ( B < A && A != C)
    if ( ( A > B && A < C ) || ( A < B && A > C ) )
    if ( C > B && B > A )
    cout << "CBA" ;
    
    A = 2 , B = 0 , C = 1 ;
    if ( B < A && A != C)
    if ( A > B && A > C )
    if ( ( C > B && B < A ) || ( C < B && B > A ) )
    cout << "BCA" ;
    
    A = 1, B = 0 , C = 2 ;
    if ( ( B < A && A == C ) || ( B > A && A != C ) )
    if ( A > B && A > C )
    if ( C < B && B < A )
    cout << "BAC" ;
    
    A = 1 , B = 2 , C = 0 ;
    if ( ( B < A && A == C ) || ( B > A && A != C ) )
    if ( A < B && A < C )
    if ( C > B && B > A )
    cout << "CAB" ;
    
    A = 0 , B = 2 , C = 1 ;
    if ( B > A && A == C )
    if ( A < B && A < C )
    if ( ( C > B && B < A ) || ( C < B && B > A ) )
    cout << "ACB" ;
    
    A = 0 , B = 1 , C = 2 ;
    if ( B > A && A == C )
    if ( ( A > B && A < C ) || ( A < B && A > C ) )
    if ( C < B && B < A )
    cout << "ABC" ;
    
    return 0 ;
}
// ( > w < ) finished~
int main()
{
	int a=0;
	int b=0;
	int c=0;
	int i=0;
	char j[5];
	int words[5]={0};
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
		{
			for(c=1;c<=3;c++)
			{
				words[a]=(a<b)+(c==a);
				words[b]=(a>b)+(a>c);
				words[c]=(c>b)+(b>a);
				j[a]='A';
				j[b]='B';
				j[c]='C';
				if((words[a]+a)==3&&(words[b]+b)==3&&(words[c]+c)==3)
				{
					for(i=1;i<=3;i++)
					{
						cout <<j[i];
					}
				}
			}break;
		}
	}
return 0;
}
int main()
{
	char a[3],T;
	int b[3];
	int i,j,k,f,t,p[3];
	for(i=0;i<3;i++)
		for(j=0;j<3;j++)
			for(k=0;k<3;k++)
			{
				p[0]=((i<j)+(i==k)+i);
				p[1]=((i>j)+(i>k)+j);
				p[2]=((k>j)+(j>i)+k);
				if(p[0]==2&&p[1]==2&&p[2]==2)
				{
					b[0]=i;
					b[1]=j;
					b[2]=k;
					a[0]='A';
					a[1]='B';
					a[2]='C';
				}
			}
			for(int u=0;u<2;u++)
				for(int r=0;r<2-u;r++)
				{
					if(b[r]>b[r+1])
					{
						t=b[r];
						b[r]=b[r+1];
						b[r+1]=t;
						T=a[r];
						a[r]=a[r+1];
						a[r+1]=T;
					}
				}
				for(int u=0;u<3;u++)
					cout<<a[u];
				
				return 0;
}
/*
 * 20.cpp
 *
 *  Created on: 2012-10-17
 *      Author: AK
 */
int main()
{
	int A,B,C;
	int c1,c2,c3,p,d,f;
	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)))         //??A?B?C???????????
               {
            	   c1=(B>A)+(C==A);                  //?c1,c2,c3?????????????
            	   c2=(A>B)+(A>C);
            	   c3=(C>B)+(B>A);
            	   p=(((c1>c2)+(A<B))!=1);           //?????????????????p=1?????
            	   d=(((c1>c3)+(A<C))!=1);
            	   f=(((c3>c2)+(C<B))!=1);
            	   if(p&&d&&f)                  //??p?d?f??1???????
            	   {
            		   for(p=1;p<=3;p++)          //??3????????2???1
            		   	{
            		   	  if(A==p) cout<<'A';
            		   	  if(B==p) cout<<'B';
            		   	  if(C==p) cout<<'C';
            		   	}
            	   }
               }
			}
	return 0;
}
main ()
{
int a,b,c,i,j;
int s[3];
char n;
for (a=0;a<3;a++)
{
    for (b=0;b<3;b++)
    {
        for (c=0;c<3;c++)
        {
            s[0]=(a<b)+(a==c);
            s[1]=(a>b)+(a>c);
            s[2]=(b<c)+(b>a);
            if (((s[0]+a)==(s[1]+b)&&(s[1]+b)==(s[2]+c))&&(a!=b)&&(a!=c)&&(b!=c))
                {
                    for (i=0;i<3;i++)
                    {
                        for (j=0;j<3;j++)
                        {
                            if ((s[j]+i)==2)
                            {
                                n=65+j;
                                printf("%c",n);
                            }

                        }
                    }
                }
        }
    }
}

}
int prime(int);
int main()
{
	int a,b,c;
	for(int a=1;a<=3;a++)
	{
		for(int b=1;b<=3;b++)
		{
			if(b==a) continue;
			for(int c=1;c<=3;c++)
			{
				if(c==a||c==b) continue;
				int A=(b>a)+(c==a);
				int B=(a>b)+(a>c);
				int C=(c>b)+(b>a);
				if(A+a==3&&B+b==3&&C+c==3)
					for(int i=1;i<=3;i++)
					{
						if(i==a)
							cout<<"A";
						if(i==b)
							cout<<"B";
						if(i==c)
							cout<<"C";
					}
			}
		}
	}
	return 0;
}
int main()
{
	int a=0,b=0,c=0,a1=0,b1=0,c1=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))
				{	a1=(b>a)+(c==a);
					b1=(a>b)+(a>c);
					c1=(c>b)+(b>a);
					if(((a+a1)==2)&&((b+b1)==2)&&((c+c1)==2))
					{
						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;
}
/*
 * ???.cpp
 *?????A,B,C???
 *  Created on: 2012-10-4
 *  Author:???
 */


int main()
{
	int A=2,B=1,C=0,a,b,c;//??????C<B<A
	a=(B>A)+(C==A);       //a??????
	b=(A>B)+(A>C);        //b??????
	c=(C>B)+(B>A);        //c??????
	if(a<b&&b<c)          //???
		cout<<"CBA"<<endl;//??
	else
		;
	A=2,C=1,B=0;          //ACB
	a=(B>A)+(C==A);
    b=(A>B)+(A>C);
    c=(C>B)+(B>A);
	if(a<c&&c<b)
		cout<<"BCA"<<endl;
	else
		;
	B=2,A=1,C=0;         //CAB
	a=(B>A)+(C==A);
	b=(A>B)+(A>C);
	c=(C>B)+(B>A);
	if(b<a&&a<c)
	cout<<"CAB"<<endl;
	else
		;
	B=2,C=1,A=0;         //ACB
	a=(B>A)+(C==A);
	b=(A>B)+(A>C);
	c=(C>B)+(B>A);
	if(b<c&&c<a)
    cout<<"ACB"<<endl;
	else
		;
	C=2,B=1,A=0;         //ABC
	a=(B>A)+(C==A);
	b=(A>B)+(A>C);
	c=(C>B)+(B>A);
	if(c<b&&b<a)
	cout<<"ABC"<<endl;
	else
		;
	C=2,A=1,B=0;         //BAC
	a=(B>A)+(C==A);
	b=(A>B)+(A>C);
	c=(C>B)+(B>A);
	if(c<a&&a<b)
	cout<<"BAC"<<endl;
	else
		;
	return 0;
	}
//****************************************
//*??????                         **
//*????? 1100012762                **
//*???2011.10.21                     **
//****************************************
int main()
{
	int a[4], A[4];
	char ch[4] = {0, 65, 66 ,67}, b[4];                                      //???????????b???????????????
	for (a[1] = 1; a[1] <= 3; a[1]++)
	{
		for (a[2] = 1; a[2] <= 3; a[2]++)
		{
			for (a[3] = 1; a[3] <= 3; a[3]++)
			{
				A[1] = (a[2] > a[1]) + (a[3] == a[1]);
				A[2] = (a[1] > a[2]) + (a[1] > a[3]);
				A[3] = (a[3] > a[2]) + (a[2] > a[1]);
				if (a[1] + A[1] == 3 && a[2] + A[2] == 3 && a[3] + A[3] == 3)//?????????????????????123??????321?
				{
					for (int i = 1;i <= 3; i++)
					{
						b[a[i]] = ch[i];                                     //?????????????????????????????
					}
					cout << b[1] << b[2] << b[3] << endl;
				}
			}
		}
	}
	return 0;
}
int main()
{
 int a, b, c, x, y, z;
 for (a = 1; a <= 3; a++) 
  {
   for (b = 1; b <= 3; b++)
   {
    if (b == a)
    continue;
    for (c = 1; c <= 3; c++)
     {
      if ((c == b) || (c == a))
      continue;
      x = (b >= a) + (c == a);
      y = (a >= b) + (a >= c);
      z = (c >= b) + (b >= a);
      if (((x + a) == (y + b)) && ((y + b) == (z + c)))
      {
       if (a > b)
        {
          if (b > c)
            cout<< "C" << "B" << "A" ;
          else if (a > c)
            cout<< "B" << "C" << "A";
          else
            cout<< "B" << "A" << "C";
         }
       else
        {
          if (a > c)
            cout << "C" << "A" << "B";
          else if (b > c)
            cout << "A" << "C" << "B";
          else
            cout << "A" << "B" << "C";
         }
      }
    }
   }
  }
   return 0;
}
/*3??????????????
A??B??????C???????
B??A??????A??C???
C????B????B?A????
?????????????????????
???????????3??????
????
???
???? 
????????3???????
ABC */
int main(){
	int a,b,c;
	for(a=1;a<4;a++)
	for(b=1;b<4;b++)
	for(c=1;c<4;c++)
	if(((b>a)+(c==a)==3-a)&&((a>b)+(a>c)==3-b)&&((c>b)+(b>a)==3-c)){
		if(a==2&&b==1&&c==3)
			cout<<"B"<<"A"<<"C";
	    if(a==2&&b==3&&c==1)
	    	cout<<"C"<<"A"<<"B";
	    if(a==3&&b==1&&c==2)
	    	cout<<"B"<<"C"<<"A";
	    if(a==3&&b==2&&c==1)
	    	cout<<"C"<<"B"<<"A";
}
	return 0;
}
int main()
{
	int A=1,B=1,C=1,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)+(a>b)!=1)+((A<C)+(a>c)!=1)+((B<C)+(b>c)!=1)+((A>B)+(a<b)!=1)+((A>C)+(a<c)!=1)+((B>C)+(b<c)!=1)+((A==B)+(a==b)!=1)+((A==C)+(a==c)!=1)+((B==C)+(b==c)!=1)==9)
				{
		        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;
}
/*
 * Homework3.15CompareAppetite.cpp
 *
 *  Created on: 2013-10-28
 *      Author: JuiceHe
 */
int main()
{
	void sort(int,int,int);
	int A,B,C,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++)
	{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)//???????????
			 {sort(A,B,C);break;}//???sort??????
	}

	return 0;
}

void sort(int x,int y,int z)//??????
{
	char M,X,Y,Z;
	X='A';Y='B';Z='C';
	if(y>x){M=Y;Y=X;X=M;}
	if(z>y)
	{if(z>x){M=Z;Z=Y;Y=X;X=M;}
	 else {M=Z;Z=Y;Y=M;}
	}
	cout<<Z<<Y<<X<<endl;//??????
}
int main()
{int i=0;
int a=0,b=0,c=0;
for(a=0;a<3;a++)
for(b=0;b<3;b++)
for(c=0;c<3;c++)
{if((a+b+c==3)&&((b>a)+(c==a)+a==2)&&((a>b)+(a>c)+b==2)&&((c>b)+(b>a)+c==2))
for(i=0;i<3;i++)
{if(a==i) cout<<"A";
else
if(b==i) cout<<"B";
else
if(c==i) cout<<"C";else;
}
}
return 0;
}
int main()
{
	int A,B,C;
	char quantity[4];
	int 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))//?????????????????????????????
				{
					quantity[A]='A';
				    quantity[B]='B';
					quantity[C]='C';
					for(int i=1;i<=3;i++)
						cout<<quantity[i];//???????
				}
			}
		}
	}
	cout<<endl;
	
	return 0;
}
int main()
{
	int a, b, c, i, j, h;
	char m[3];
	for (i = 1; i <= 3; i++)
	{
		for (j=1;j<=3;j++)
		{
			for (h=1;h<=3;h++)
			{
				a = ((j>i)+(h==i));
				b = ((i>j)+(i>h));
				c = ((h>j)+(j>i));
				if (a != b && b != c && c != a )
				{
					m[a] = 'A';
					m[b] = 'B';
					m[c] = 'C';
					if (a + i == 3 && b + j == 3 && c + h == 3)
					cout << m[2] << m[1] << m[0];
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a, b, c, A, B, C, D, E, F;
	for(a = 1; a <= 2; a++)
		for(b = 1; b <= 2; b++)
			for(c = 1; c <= 2; c++)
			{
				A = b > a;
				B = c == a;
				C = a > b;
				D = a > c;
				E = c > b;
				F = b > a;
				if((A + B) * (D + C) * (E + F) == 0 && A + B + C + D + E + F == 3)
				{
					if(A + B == 2)
					{
						if(C + D == 0)
							cout << "B" << "C" << "A" << endl;
						if(E + F == 0)
							cout << "C" << "B" << "A" << endl;
					}
					if(D + C == 2)
					{
						if(A + B == 0)
							cout << "A" << "C" << "B" << endl;
						if(E + F == 0)
							cout << "C" << "A" << "B" << endl;
					}
					if(E + F == 2)
					{
						if(A + B == 0)
							cout << "A" << "B" << "C" << endl;
						if(C + D == 0)
							cout << "B" << "A" << "C" << endl;
					}
				}
			}
			return 0;
}