semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c,A,B,C,i;
	for(a=3;a>=1;a--)
	{
		for(b=3;b>=1;b--)
		{
			if(a!=b)
			{
				for(c=3;c>=1;c--)
				{
					if(a!=c&&b!=c)
					{
						A=(b>a)+(c==a);
						B=(a>b)+(a>c);
						C=(c>b)+(b>a);
						if(a+A==3&&b+B==3&&c+C==3)
						{
							for(i=1;i<=3;i++)
							{
								if(a==i)
									cout<<"A";
								if(b==i)
									cout<<"B";
								if(c==i)
									cout<<"C";
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
/*3?????????????? 
A??B??????C??????? 
B??A??????A??C??? 
C????B????B?A???? 
????????????????????? 
???????????3??????*/
//Goofy 2010 11 19
int main()
{
	char peo[4];
	int a, b, c, i, judger=0;
	peo[3]='\0';
	for (a=0; a<3; a++)
	for (b=0; b<3; b++)
	for (c=0; c<3; c++)
	{
		judger=0;
		peo[a]='A';
		peo[b]='B';
		peo[c]='C';
		if ( (b>a) + (c==a) == 2-a)//A
			judger++;
		if ( (a>b) + (a>c) == 2-b)//B
			judger++;
		if ( (c>b) + (b>a) == 2-c)//C
			judger++;
		if (judger == 3)
			cout<<peo<<endl;
	}
	return 0;
}
int main(){
	int a,b,c,As,Bs,Cs;//??abc?? ? ABC???
	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;
				 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))
                 for(int i=1;i<=3;i++)//?????????i???????
                	 {
                	 if(a==i) cout<<'A';
                	 if(b==i) cout<<'B';
                	 if(c==i) cout<<'C';
                	 }
				 }


			}

}
int main()
{
	int aw,bw,cw;  //????????????????????????
	int i,j,t;                                   //???????????
	char m[3]={'A','B','C'},p;     //????????????
	int n[3];                            //????????
	for(n[0]=1;n[0]<=3;n[0]++)      //????
	{
		for(n[1]=1;n[1]<=3;n[1]++)
		{
			for(n[2]=1;n[2]<=3;n[2]++)
			{
				aw=((n[1]>n[0])+(n[2]==n[0]));    //????????
				bw=((n[0]>n[1])+(n[0]>n[2]));
				cw=((n[2]>n[1])+(n[1]>n[0]));
				if(((n[0]>n[1])&&(aw<bw))||((n[1]>n[0])&&(bw<aw))||((n[1]==n[0])&&(bw==aw)))
				{
					if(((n[2]>n[1])&&(cw<bw))||((n[1]>n[2])&&(bw<cw))||((n[1]==n[2])&&(bw==cw)))
					{
						if(((n[0]>n[2])&&(aw<cw))||((n[2]>n[0])&&(cw<aw))||((n[2]==n[0])&&(cw==aw)))
						{
							goto l;
						}
					}
				}
			}
		}
	}
l:	for(i=2;i>0;i--)                            //???????????
	{
		for(j=0;j<i;j++)
		{
			if(n[j]>n[j+1])
			{
				t=n[j];p=m[j];
				n[j]=n[j+1];m[j]=m[j+1];
				n[j+1]=t;m[j+1]=p;
			}
		}
	}
	printf("%c%c%c",m[0],m[1],m[2]);   //?????
	return 0;
}
int main()
{
	int A,B,C;//????????
	int words[4];//??????????????
	int 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;
				words[1]=(B>A)+(C==A);
				words[2]=(A>B)+(A>C);
				words[3]=(C>B)+(B>A);
				rank[A]=1;
				rank[B]=2;
				rank[C]=3;
				if(words[rank[1]]>words[rank[2]]&&words[rank[2]]>words[rank[3]])//??????????????
					cout<<(char)(rank[1]+64)<<(char)(rank[2]+64)<<(char)(rank[3]+64)<<endl;//????
			}
		}
	}
			return 0;
}
int main()
{
	int a,b,c,i1,i2,i3,i4,i5,i6,i7,i8,i9,i;
	char 	n[3];
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
			for(c=0;c<=2;c++)
			{
				i1=(b>a);
				i2=(a==c);
				i3=(a>b);
				i4=(a>c);
				i5=(c>b);
				i6=(b>a);
				i7=a+i1+i2;
				i8=b+i3+i4;
				i9=c+i5+i6;

     if (i7==2&&i8==2&&i9==2)
	 {
		 n[a]='A';
		 n[b]='B';
		 n[c]='C';
		 for(i=0;i<3;i++)
			 cout<<n[i];}



	 }
	 
		
			return 0;
}
int main ()
{
    int i,j,k,l,m,n;
    int a[3];
    int c[3];
    char b[3]={'A','B','C'};
    for (i=0;i<3;i++)
    {
        a[0]=i;

        for (j=0;j<3;j++)
        {
            a[1]=j;if (a[0]==a[1])continue;
            for (k=0;k<3;k++)
            {
                a[2]=k;if (a[2]==a[1]||a[2]==a[0])continue;
                c[0]=(a[1]>a[0])+(a[0]==a[2]);
                c[1]=(a[0]>a[1])+(a[0]>a[2]);
                c[2]=(a[2]>a[1])+(a[1]>a[0]);
                if (a[0]<a[1]&&c[0]>c[1])
                {
                    if (a[1]<a[2]&&c[1]>c[2])
                    cout <<b[0] <<b[1] <<b[2] <<endl;
                }
                if (a[0]<a[2]&&c[0]>c[2])
                {
                    if (a[2]<a[1]&&c[2]>c[1])
                    cout <<b[0] <<b[2] <<b[1] <<endl;
                }
                if (a[1]<a[0]&&c[1]>c[0])
                {
                    if (a[0]<a[2]&&c[0]>c[2])
                    cout <<b[1] <<b[0] <<b[2] <<endl;
                }
                if (a[1]<a[2]&&c[1]>c[2])
                {
                    if (a[2]<a[0]&&c[2]>c[0])
                    cout <<b[1] <<b[2] <<b[0] <<endl;
                }
                if (a[2]<a[0]&&c[2]>c[0])
                {
                    if (a[0]<a[1]&&c[0]>c[1])
                    cout <<b[2] <<b[0] <<b[1] <<endl;
                }
                if (a[2]<a[1]&&c[2]>c[1])
                {
                    if (a[1]<a[0]&&c[1]>c[0])
                    cout <<b[2] <<b[1] <<b[0] <<endl;
                }

            }
        }
    }
    return (0);
}
int main()
{    
	char Rank[3];                                                                       //????Rank??A,B,C?????          
	int A,B,C,Word[3],i=1;                                                             //????Word??A,B,C????????
	for(A=1;A<4;A++)                                                                    //??????
		for(B=1;B<4;B++)
			if(B!=A)
			{
				C=6-A-B;
				Word[A-1]=(A<B)+(A==C);
				Word[B-1]=(A>B)+(A>C);
				Word[C-1]=(C>B)+(B>A);
				Rank[A-1]='A';
				Rank[B-1]='B';
				Rank[C-1]='C';
			    if((A+Word[A-1]==3)&&(B+Word[B-1]==3)&&(C+Word[C-1]==3))      //???????????3???????
				{for(i=1;i<4;i++)                                          //??????3?????
				 cout<<Rank[i-1];}
			}
	return 0;
}
/*file:????11-17??
 *author:??? 1000012776
 *date:2010-11-19
 *discription:???
 */
int main ()
{
	int i , j , k , m , ai ,aj ,ak ;//i,j,k????A,B,C????ai,aj,ak???A,B.C????????
	for ( i = 0 ; i < 3 ; i ++ )//???
		for ( j = 0 ; j < 3 ; j ++ )
			for ( k = 0 ; k < 3 ; k ++ )
			{
				ai = ( j > i ) + ( i == k ) ;
				aj = ( i > j ) + ( i > k ) ;
				ak = ( k > j ) + ( j > i ) ;
				//????????????????????????????????????????????
				if ( ( ( i > j ) == ( ai < aj ) ) && ( ( i < j ) == ( ai > aj ) )
				  && ( ( i > k ) == ( ai < ak ) ) && ( ( i < k ) == ( ai > ak ) )
				  && ( ( k > j ) == ( ak < aj ) ) && ( ( k < j ) == ( ak > aj ) ) )
				//??????????????????m??A?B?C???????
				for ( m = 0 ; m <= 2 ; m ++ )
				{
					if ( i == m ) cout << "A" ;
					if ( j == m ) cout << "B" ;
					if ( k == m ) cout << "C" ;
				}
			}
			return 0 ;
}
int main()
{
	int logicA , logicB , logicC;                                                                       
	int eatA , eatB , eatC;
	char ABC[3];
	for ( eatA = 1; eatA <=3; eatA++ )
	{
		for ( eatB = 1; eatB <=3; eatB++ )
		{
			for ( eatC = 1; eatC <=3; eatC++ )
			{
				logicA = ( (eatB > eatA) + (eatA == eatC) );
				logicB = ( (eatA > eatB) + (eatA > eatC) );
				logicC = ( (eatC > eatB) + (eatB > eatA) );
				if ( ((eatA > eatB && logicA < logicB)
					|| (eatA < eatB && logicA > logicB) || (eatA == eatB && logicA == logicB))
					+ ((eatA > eatC && logicA < logicC)
					|| (eatA < eatC && logicA > logicC) || (eatA == eatC && logicA == logicC))
					+ ((eatC > eatB && logicC < logicB)
					|| (eatC < eatB && logicC > logicB) || (eatC == eatB && logicC == logicB)) == 3 )
				{
					ABC[eatA] = 'A';
					ABC[eatB] = 'B';
					ABC[eatC] = 'C';
					cout << ABC[1] << ABC[2] << ABC[3];
				}
			}
		}
	}
	
	return 0;

}
//???
//2010?11?17?
//1000012753 ???
int main()
{
	int A = 0, B = 0, C = 0;
	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)
				{
					if ((B > A) + (B == C) + A == 2
						&& (A > B) + (A > C) + B == 2
						&& (C > B) + (B > A) + C == 2)
					{
						char output[5];
						output[A] = 'A';
						output[B] = 'B';
						output[C] = 'C';
						output[3] = '\0';
						cout << output;
						cout << endl;
					}				
				}
			}

	return 0;
}
int main()
{ int vol[3]={0},judge[3]={0},i,j,k,ri,rj;
  for(i=0;i<3;i++)
  {
	  for(j=0;j<3;j++)
	  {
		  for(k=0;k<3;k++)
		  {
			  vol[0]=i;vol[1]=j;vol[2]=k;
			  judge[0]=(vol[0]<vol[1])+(vol[2]==vol[0]);
			  judge[1]=(vol[0]>vol[1])+(vol[0]>vol[2]);
			  judge[2]=(vol[2]>vol[1])+(vol[1]>vol[0]);

			  for(ri=0;ri<3;ri++)
			  {
				  for(rj=0;rj<3;rj++)
				  {
					  if( (vol[ri]>=vol[rj]) && (judge[ri]>judge[rj]) ) goto end1;
				  }
			  }

			  for(ri=2;ri>=0;ri--)
			  {
				  for(rj=0;rj<3;rj++)
				  {
					  if(vol[rj]==ri) cout<<(char)(rj+65);
				  }
				  
			  }
			  goto endall ;
			  end1:  ;
		  }
	  }
  }
  endall: ;

  cin.get();
  cin.get();
  cin.get();

	return 0;
}
int main()
{
	int A,B,C;                                                   //??????
	char x[3];
	for (A=0;A<=2;A++)
	{
		for (B=0;B<=2;B++)
		{
			if (A==B)
				continue;
			for (C=0;C<=2;C++)
			{
				if (A==C||B==C)
					continue;                                    //?A,B,C??????
				x[A]=(B>A)+(A==C);
				x[B]=(A>B)+(A>C);
				x[C]=(C>B)+(B>A);                                //???????
				if (x[2-A]==A&&x[2-B]==B&&x[2-C]==C)
				{
					x[A]='A';
					x[B]='B';
					x[C]='C';                                    //??
					cout<<x[0]<<x[1]<<x[2]<<endl;      //??
				}
			}
		}
	}
	return 0;
}
/*
 * 12.10.28.cpp
 *Created on: 2012-10-28
 *Author: ???
 *??:???
 */

int comp(int a, int b) {
	if (a > b)
		return 1;
	if (a == b)
		return 0;
	return -1;
}
int main() {
	int A, B, C, nA, nB, nC;
	char ret;
	for (A = 0; A <= 2; A++) {
		for (B = 0; B <= 2; B++) {
			for (C = 0; C <= 2; C++) {
				nA = (B > A) + (C == A);
				nB = (A > B) + (A > C);
				nC = (C > B) + (B > A);
				ret = true;
				if (comp(nA, nB) != comp(B, A))
					ret = false;
				if (comp(nA, nC) != comp(C, A))
					ret = false;
				if (comp(nC, nB) != comp(B, C))
					ret = false;
				if (ret == true) {
					if (A < B && A < C) {
						cout << 'A';
						if (B < C)
							cout << "BC";
						else
							cout << "CB";
					} else if (B < C) {
						cout << 'B';
						if (A < C)
							cout << "AC";
						else
							cout << "CA";
					} else
						cout << "CBA";
				}

			}
		}
	}
	return 0;
}
int main()
{
	int a[3],b[3],i=0,k=0;
	char rank[3];
	rank[0]='A';
	rank[1]='B';
	rank[2]='C';
	for(a[0]=0;a[0]<3;a[0]++)
	{
		for(a[1]=0;a[1]<3;a[1]++)
		{
			for(a[2]=0;a[2]<3;a[2]++)
			{
				b[0]=(a[1]>a[0])+(a[2]==a[0]);
				b[1]=(a[0]>a[1])+(a[0]>a[2]);
				b[2]=(a[2]>a[1])+(a[1]>a[0]);
				if(a[0]+b[0]==2&&a[1]+b[1]==2&&a[2]+b[2]==2)
				{
					for(k=0;k<=2;k++)
					{
						for(i=0;i<3;i++)
						{
							if(a[i]==k)
								cout<<rank[i];
						}
					}
					cout<<endl;
				}
			}
		}
	}
	cin.get();cin.get();
	return 0;
}
int main()
{
	int i,j,k;
	for (i=0;i<=2;i++)
	{
		for (j=0;j<=2;j++)
		{
			for (k=0;k<=2;k++)
				if ((((j>i)+(k==i))==2-i)&&(((i>j)+(i>k))==2-j)&&(((k>j)+(j>i))==2-k))
				{
				//	if (i==2&&j==1&&k==0)
				//		cout<<"ABC"<<endl;
				//	if (i==2&&j==0&&k==1)
				//		cout<<"ACB"<<endl;
				//	if (i==1&&j==0&&k==2)
				//		cout<<"CAB"<<endl;
				//	if (i==1&&j==2&&k==0)
					//	cout<<"BAC"<<endl;
				//	if (i==0&&j==1&&k==2)
				//		cout<<"CBA"<<endl;
				//	if (i==0&&j==2&&k==1)
					cout<<"BCA"<<endl;
				//	cout<<i<<j<<k;
				}
		}
	}
	return 0;
}
int main()
{
  int i,a,b,c,as,bs,cs;
  for(a=1;a<4;a++)
  for(b=1;b<4;b++)
  for(c=1;c<4;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)) )
      for(i=1;i<4;i++)
      {
          if(a==i) printf("A");
          if(b==i) printf("B");
          if(c==i) printf("C");
      }
  }
  return 0;
}
int exam( char s[4], char t );

int main()
{
    char order[6][4]={"ABC", "ACB", "BAC", "BCA", "CAB", "CBA"};
    for( int i=0; i<6; i++ )
    {
        int a=0, b=0, c=0;
        if( exam( order[i], 'B') < exam( order[i], 'A') )
           a++;
        if( exam( order[i], 'C')-exam( order[i], 'A') ==1 )
           a++;
        if( exam( order[i], 'C')-exam( order[i], 'A') ==-1 )
           a++;
        if( exam( order[i], 'A') < exam( order[i], 'B') )
           b++;
        if( exam( order[i], 'A') < exam( order[i], 'C') )
           b++;
        if( exam( order[i], 'C') < exam( order[i], 'B') )
           c++;
        if( exam( order[i], 'B') < exam( order[i], 'A') )
           c++;
        int k=0;
        if( exam( order[i], 'A') == a)
            k++;
        if( exam( order[i], 'B') == b)
            k++;
        if( exam( order[i], 'C') == c)
            k++;
        if( k == 3 )
            cout << order[i];

    }
    return 0;
}

int exam( char s[4], char t )
{
    for( int i=0; i<3; i++ )
    {
        if( s[i]== t)
            return i;
    }
}
int main()
{
	int a[5],markA=0,markB=0,markC=0;
	for(int x=1;x<=3;x++)
	{
		for(int y=1;y<=3;y++)
		{
			for(int z=1;z<=3;z++)
			{
				if(x!=y && y!=z && x!=z)
				{
				 a[x]=3;a[y]=2;a[z]=1;
				 //for A
				 markA=0;markB=0;markC=0;
				 if (a[2]>a[1]) markA++;
				 if (a[1]>a[2]) markB++;
				 if (a[1]>a[3]) markB++;
				 if (a[3]>a[2]) markC++;
				 if (a[2]>a[1]) markC++;
				 if(markA==3-a[1] && markB==3-a[2] && markC==3-a[3])
			 	 {
					if(a[1]<a[2] && a[1]<a[3]) 
					{
					  cout<<"A";
					  if(a[2]<a[3]) cout<<"BC"; else cout<<"CB";
				    }
					else if(a[2]<a[3] && a[2]<a[1])
					{
					  cout<<"B";
					  if(a[1]<a[3]) cout<<"AC"; else cout<<"CA";
			    	}
			    	else
			    	{
			    	  cout<<"C";
			    	  if(a[1]<a[2]) cout<<"AB"; else cout<<"BA";
			        }
			     }
			    }
			}
		}
	}
	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 ((((cc2 - cc1) * (b - a)) > 0 || ((cc1 == cc2) && (a == b)))
					&& (((cc2 - cc3) * (b - c)) > 0 || ((cc2 == cc3) && (b == c)))
					&& (((cc3 - cc1) * (c - a)) > 0 || ((cc3 == cc1) && (c == a))))//???????????????????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;
}
int main()                                  //?????
{ 
	int A,B,C,i,j,x;                        //????ABC????3??????????i,j,????x
	int a[3];                               //????
	char b[3]={'A','B','C'};
	char p;
	for(A=0;A<=2;A++)                       //???????????????
	{
		for(B=0;B<=2;B++)
		{
			for(C=0;C<=2;C++)
			{
				if((B>A)+(C==A)==2-A&&(A>B)+(A>C)==2-B&&(C>B)+(B>A)==2-C)            //??????????
				{
					a[0]=A;
					a[1]=B;
					a[2]=C;
				}
			}
		}
	}
	for(i=0;i<=1;i++)                       //?????????a[3],b[3]??
	{
		for(j=0;j<=1-i;j++)
		{
			if(a[j]>a[j+1])
			{
				p=a[j+1];
				a[j+1]=a[j];
				a[j]=p;
				x=b[j+1];
				b[j+1]=b[j];
				b[j]=x;
			}
		}
	}
	for(i=0;i<=2;i++)                       //????????
	{
		cout<<b[i];
	}
	cout<<endl;
	return 0;
}
int main()
{
	int		person[3];
	int		fan[3];
	int		hua[3];	
	int	i, j, k;
	
	for (i = 0; i < 3; i ++)
	{
		for (j = 0; j < 3; j ++)
		{
			if(j == i){continue;}
			for (k = 0; k < 3; k ++)
			{
				if((k == j) || (k == i)){continue;}
				
				person[0] = i;		//?0??????i
				person[1] = j;
				person[2] = k;
				fan[person[0]] = 0;	//???i???0??
				fan[person[1]] = 1;
				fan[person[2]] = 2;

				hua[0] = (person[1] > person[0]) + (person[2] == person[0]);
				hua[1] = (person[0] > person[1]) + (person[0] > person[2]);
				hua[2] = (person[2] > person[1]) + (person[1] > person[0]);
				
				int	p;
				for (p = 0; p < 3; p ++)
				{
					if(person[p] + hua[p] != 2)
					{
						break;
					}
				}
				
				
				if(p == 3)
				{
					int	t;
					for (t = 0; t < 3; t ++)
					{
						cout << (char)('A' + fan[t]);
					}
				}
			
			}
		}
	}

return 0;
}
/*
 * 05.cpp
 *??? ???
 *  Created on: 2012-10-18
 *      Author: ???
 */
int main()
{
	int A,B,C,p,m,n;
	A=3;B=2;C=1;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==0&&m==1&&n==2)cout<<"CBA"<<endl;
	A=3;B=1;C=2;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==0&&m==2&&n==1)cout<<"BCA"<<endl;
	A=2;B=3;C=1;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==1&&m==0&&n==2)cout<<"CAB"<<endl;
	A=1;B=3;C=2;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==2&&m==0&&n==1)cout<<"ACB"<<endl;
	A=1;B=2;C=3;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==2&&m==1&&n==0)cout<<"ABC"<<endl;
	A=2;B=1;C=3;
		p=(A<B)+(A==C);
		m=(A>B)+(A>C);
		n=(C>B)+(B>A);
		if(p==1&&m==2&&n==0)cout<<"BAC"<<endl;
	return 0;
}
//**********************************
//****       ??????     *****
//****        1200016612       *****
//**      ??????    **********
//**********************************
int main()                                                   //?????
{
	int A,B,C,c[3],t;
	for(A=0;A<=2;A++){                                        //?A,B,C??????0,1,2??
		for(B=0;B<=2;B++){
			for(C=0;C<=2;C++){
				c[0]=(B>A)+(C==A);                            //????????????       
				c[1]=(A>B)+(A>C);
				c[2]=(C>B)+(B>A);
				if(c[0]+A==2&&c[1]+B==2&&c[2]+C==2){          //?????????0,1,2???????????????????2
					if(A<=B&&B<=C)                            //?????
						cout<<"ABC"<<endl;
					if(A<=C&&C<=B)
						cout<<"ACB"<<endl;
					if(B<=A&&A<=C)
						cout<<"BAC"<<endl;
					if(B<=C&&C<=A)
						cout<<"BCA"<<endl;
					if(C<=A&&A<=B)
						cout<<"CAB"<<endl;
					if(C<=B&&B<=A)
						cout<<"CBA"<<endl;}
			}
		}
	}
	return 0;				
}
char max(int a,int b, int c){
			if((a>b)&&(a>c)) return 'A';
			if((b>a)&&(b>c)) return 'B';
			if((c>b)&&(c>a)) return 'C';
			}

			char min(int a,int b, int c){
			if((a<b)&&(a<c)) return 'A';
			if((b<a)&&(b<c)) return 'B';
			if((c<b)&&(c<a)) return 'C';
			}
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==(3-(b>a)-(c==a)))&&(b==(3-(a>b)-(a>c)))&&(c==(3-(c>b)-(b>a))))
			{  
				cout<<min(a,b,c);
			   if(max(a,b,c)-'A'+min(a,b,c)-'A'==2) cout<<"B";
               if(max(a,b,c)-'A'+min(a,b,c)-'A'==3) cout<<"A";
			   if(max(a,b,c)-'A'+min(a,b,c)-'A'==1) cout<<"C";
			   cout<<max(a,b,c);  }}
	   
return 0;
}
/*
 * fanliang.cpp
 *??????
 *  Created on: 2012-10-27
 *      Author: ??
 */

int main(){
	int a,b,c,i,j;//????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;//????
				if(((b>a)+(c==a)==(3-a))&&((a>b)+(a>c)==(3-b))&&((c>b)+(b>a)==(3-c))){//?????????
					int e[3]={a,b,c};
					char f[3]={'A','B','C'};
					for(i=0;i<2;i++)
						for(j=0;j<2-i;j++)
							if(e[j]>e[j+1]){
								swap(e[j],e[j+1]);
								swap(f[j],f[j+1]);
							}//????
					for(i=0;i<3;i++)
						cout<<f[i];//??
					break;
				}
			}
	return 0;
}
int main()
{
	int A, B, C, x1, x2, x3; 
	char mun[4];
	for(A = 0; A < 3; A++)
		for(B = 0; B < 3; B++)
			for(C = 0; C < 3; C++)
			{
				x1 = (B > A) + (C == A);
				x2 = (A > B) + (A > C);
				x3 = (C > B) + (B > A);
 				if((x1 + A == 2) && (x2 + B == 2) && (x3 + C == 2) && A !=B && B != C && C != A)
				{
					mun[A] = 'A';
					mun[B] = 'B';
					mun[C] = 'C';	
					mun[3] = '\0';
				}
			}
	cout << mun << endl;
	return 0;
}
int main()
{
	int x1,x2,x3,x4,x5,x6,a,b,c,t[3];
	for (a=0;a<=2;a++)
		for (b=0;b<=2;b++)
			for (c=0;c<=2;c++)
			{
				x1=(b>a);
				x2=(c==a);
				x3=(a>b);
				x4=(a>c);
				x5=(c>b);
				x6=(b>a);
				t[0]=x1+x2;
				t[1]=x3+x4;
				t[2]=x5+x6;
				if (t[0]==2-a&&t[1]==2-b&&t[2]==2-c)
				{
					if (t[0]>t[1]&&t[0]>t[2])
					{
						cout<<"A";
						if (t[1]>t[2])
							cout<<"BC";
						else cout<<"CB";
						return -1;
					}
					if (t[1]>t[0]&&t[1]>t[2])
					{
						cout<<"B";
						if (t[0]>t[2])
							cout<<"AC";
						else cout<<"CA";
						return -1;
					}
					if (t[2]>t[1]&&t[2]>t[0])
					{
						cout<<"C";
						if (t[1]>t[0])
							cout<<"BA";
						else cout<<"AB";
						return -1;
					}
				}
			}
			return 0;
}
int main()
{int A,B,C,i=3;
int s[3];
for(A=1;A<=3;A++)
	for(B=1;B<=3;B++)
		for(C=1;C<=3;C++)
			{s[0]=(B>A)+(C==A);
            s[1]=(A>B)+(A>C);
            s[2]=(C>B)+(B>A);
            if((s[0]!=s[1]&&s[1]!=s[2]&&s[0]!=s[2])&&(A!=B&&B!=C&&C!=A)&&(A+s[0]==B+s[1]&&B+s[1]==C+s[2]))
			for(i=1;i<=3;i++)

			{if (A==i)cout<<"A";
			else if(B==i) cout<<"B";
			else cout<<"C";}
			}
return 0;
}
int main()
{
	int A,B,C,k1,k2,k3;
         char a[3];
	for(A=2;A>=0;A--)
	{
		for(B=2;B>=0;B--)
		{
			if(A==B) continue;
			for(C=2;C>=0;C--)
			{
				if(A==C||B==C) continue;
				 k1=(B>A)+(C==A);
			     k2=(A>B)+(A>C);
				  k3=(C>B)+(B>A);
				  if(((k1-k2)*(A-B)<0)+((k1-k3)*(A-C)<0)+((k2-k3)*(B-C)<0)==3)
				  { a[A]='A';a[B]='B';a[C]='C';
				  cout<<a[0]<<a[1]<<a[2];}
			}
		}
	}
return 0;
}
/*           ???
??????           2010.11.17      */

char p(int a,int b,int c,int d)
{
	if(a == b) return 'A';
	if(a == c) return 'B';
	if(a == d) return 'C';
}//????

int main()
{
	//abc???????ABC???????
	int a = 0, b = 0, c = 0, A = 0, B = 0, C = 0;
	for(a = 0; a < 3; a ++)
		for(b = 0; b < 3; b ++)
			if(b != a)
			{
				c = 3 - a - b;//????????
				A = (b > a) + (c == a);
				B = (a > b) + (a > c);
				C = (c > b) + (b > a);
				if(a + A == 2)
					if(b + B == 2)
						if(c + C == 2)
							cout << p(0,a,b,c) << p(1,a,b,c) << p(2,a,b,c);
			}
	return 0;
}
int main()
{
    int a,b,c;              //a,b,c??A,B,C?????????1,???3?
    int word[4],rank[4];
    
    for (a=1;a<=3;a++)
      for (b=1;b<=3;b++)
       {if (b==a) continue;          //??a,b?? 
         for (c=1;c<=3;c++)
          {if ((c==a)||(c==b)) continue;  //??a,b,c?? 
           word[1]=(b>a)+(c==a);          //?????,word[1]??A??? 
           word[2]=(a>b)+(a>c);
           word[3]=(c>b)+(b>a);
           
           rank[4-a]=1;                  //????????????????????=4-??? 
           rank[4-b]=2;
           rank[4-c]=3;
           if ((word[rank[1]]==0)&&(word[rank[2]]==1)&&(word[rank[3]]==2))   //????????????????? 
             {cout<<(char)(rank[3]+64)<<(char)(rank[2]+64)<<(char)(rank[1]+64)<<endl;  //?? 
              }
           }
         }
     return 0;
}
int main()
{
    int a,b,c,a1,a2,b1,b2,c1,c2,i,A,B,C;
    for(a=0;a<3;a++)
    for(b=0;b<3;b++)
    for(c=0;c<3;c++)
    {    
         a1=0,a2=0,b1=0,b2=0,c1=0,c2=0;
        if(b<=a)a1=a1+1;
        if(c!=a)a2=a2+1;
        if(a<=b)b1=b1+1;
        if(a<=c)b2=b2=1;
        if(c<=b)c1=c1+1;
        if(b<=a)c2=c2+1;
        if(a1+a2==a&&b1+b2==b&&c1+c2==c)
        {A=a;B=b;C=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;
   int a,b,c;
   a=(B>A)+(C==A);
   b=(A>B)+(A>C);
   c=(C>B)+(B>A);
   for(A=1;A<4;A++)
     for(B=1;B<4;B++)
       for(C=1;C<4;C++)
          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)
         {
          cout<<"BCA";
          }
 return 0;
}
/*
 * shit.cpp
 *
 *  Created on: 2012-10-15
 *      Author: Administrator
 */


int main()
{
	int a,b,c,d,e,f;
	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
			for(c=1;c<=3;c++)
				if(a!=b&&b!=c&&a!=c)
				{
					d=(b>a)+(c==a);
					e=(a>b)+(a>c);
					f=(c>b)+(b>a);
					if((a+d)==(b+e)&&(a+d)==(c+f)&&(b+e)==(c+f))
					{
						if(a>b&&b>c) cout<<"CBA";
						else if(a>c&&c>b) cout<<"BCA";
						else if(b>a&&a>c) cout<<"CAB";
						else if(b>c&&c>a) cout<<"ACB";
						else if(c>b&&b>a) cout<<"ABC";
						else if(c>a&&a>b) cout<<"BAC";
					}
				}
	return 0;
}