semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c,n1,n2,n3;
	n1=n2=n3=0;
	a=1;
	b=2;
	c=3;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n1>n2>n3)
			cout<<"A"<<"B"<<"C";
	n1=n2=n3=0;
	c=1;
	a=2;
	b=3;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n3>n1>n2)
		cout<<"C"<<"A"<<"B";
	n1=n2=n3=0;
	a=1;
	b=3;
	c=2;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n1>n3>n2)
		cout<<"A"<<"C"<<"B";
	n1=n2=n3=0;
	b=1;
	a=2;
	c=3;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n1>n2>n3)
		cout<<"B"<<"A"<<"C";
	n1=n2=n3=0;
	b=1;
	c=2;
	a=3;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n2>n3>n1)
		cout<<"B"<<"C"<<"A";
	n1=n2=n3=0;
	c=1;
	b=2;
	a=3;
	if(b>a)
			n1=n1+1;
	if(c==a)
			n1=n1+1;
	if(a>b)
			n2=n2+1;
	if(a>c)
			n2=n2+1;
	if(c>b)
			n3=n3+1;
	if(b>a)
			n3=n3+1;
	if(n3>n2>n1)
		cout<<"C"<<"B"<<"A";
    return 0;
}
/**
  *file  ???
  *author ???
  *date   11.17
  *function 3?????????????? 
			A??B??????C??????? 
			B??A??????A??C??? 
			C????B????B?A???? 
			????????????????????? 
			???????????3??????
*/
int main()
{
	int a = 0, b = 0, c = 0, A, B, C;
	for(A = 0; A <= 2; A++)
	{
		for(B = 0; B <= 2; B++)
		{
			if(B == A)
			{
				continue;
			}
			else
			{
				for(C = 0; C <= 2; C++)
				{
					if(C == A || C == B)
					{
						continue;
					}
					else
					{
						a = (B > A) + (A == C);
						b = (A > B) + (A > C);
						c = (C > B) + (B > A);
						if(a + A == 2 && b + B == 2 && c + C == 2)
						{
							if(A > B > C)
							{
								cout << "CBA" << endl;
							}
							if(A > C > B)
							{
								cout << "BCA" << endl;
							}							
							if(B > A > C)
							{
								cout << "CAB" << endl;
							}							
							if(B > C > A)
							{
								cout << "ACB" << endl;
							}							
							if(C > B > A)
							{
								cout << "CBA" << endl;
							}							
							if(C > A > B)
							{
								cout << "BCA" << endl;
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
/*
 * eatingamount.cpp
 *
 *  Created on: 2013-11-3
 *      Author: ???
 */
int main()
{int a,b,c;
	int A,B,C;
	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;
				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";break;}
					if(a>c&&c>b&&A<C&&C<B){cout<<"ACB";break;}
					if(b>a&&a>c&&B<A&&A<C){cout<<"BAC";break;}
					if(b>c&&c>a&&B<C&&C<A){cout<<"BCA";break;}
					if(c>a&&a>b&&C<A&&A<B){cout<<"CAB";break;}
					if(c>b&&b>a&&C<B&&B<A){cout<<"CBA";break;}
			}

		}
		return 0;
}
int main()
{
	int a,b,c,A,B,C;
	for(A=1;A<=3;A++)
		for(B=1;B<=3;B++)
			for(C=1;C<=3;C++) //???????1????3??a,b,c????
			{
				a=(B>A)+(C==A);
				b=(A>B)+(A>C);
				c=(C>B)+(B>A);//??3??????
				a+b+c==3;
				if(A+a==3&&B+b==3&&C+c==3)//???????? ???????????????
				{
					if(A>B)
					{
						if(B>C){cout<<"CBA"<<endl;}
						else{cout<<"BCA"<<endl;}
					}
					else if(B>A)
					{
						if(A>C){cout<<"CAB"<<endl;}
						else{cout<<"ACB"<<endl;}
					}
					else if(C>A)
					{
						if(A>B){cout<<"BAC"<<endl;}
						else{cout<<"ABC"<<endl;}
					}        //????? ?? ???? 
				}
			}
			return 0;}
//============================================================================
// Name        : prac-0106.cpp
// Author      : yintao
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

int main()
{
int A,B,C;
int a,b,c;
for(A=0;A<=2;A++)
   for(B=0;B<=2;B++)
    for(C=0;C<=2;C++)
    {
     a=(B>A)+(C==A);
     b=(A>B)+(A>C);
     c=(C>B)+(B>A);
  if((a+A==2)&&(b+B==2)&&(c+C==2) )
	  {
	  if(A==2)  {
		  if(B==1)
		    cout<<"CBA"<<endl;
		  cout<<"BCA"<<endl;
	  }
	  else if(B==2) {
		  if(A==1)
		  cout<<"CAB"<<endl;
		  cout<<"ACB"<<endl;
	  }
	  else {
		  if(A==1)
		  cout<<"BAC"<<endl;
		  cout<<"ABC"<<endl;
	  }
	  }
    }
return 0;
}
//???
int main()
{
	int A, B, C, a, b, c;
	for(a = 1;a <= 3;a++)
		for(b = 1;b <= 3;b++)
			for(c = 1;c <= 3;c++)
			{
				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)) continue;
				if(A != B && A != C && B != C)
				{
					if(A + B + C == 3)
					{
						if(A == 2) cout << "A";
						if(B == 2) cout << "B";
						if(C == 2) cout << "C";
						if(A == 1) cout << "A";
						if(B == 1) cout << "B";
						if(C == 1) cout << "C";
						if(A == 0) cout << "A";
						if(B == 0) cout << "B";
						if(C == 0) cout << "C";
						cout << endl;
					}
				}
			}
	return 0;
}
//**??????*****************//
//**?????*******************//
//##???11/17##################//
int main()
{
	int a1, a2, b1, b2, c1, c2, A, B, C, i, j, k;//A?B?C???A?B?C???

	for(i = 0; i <= 2; i++)
	{
		A = i;
	    for(j = 0; j <= 2; j++)
		{
			B = j;
            for(k = 0; k <= 2; k++)                                                        //??
			{
				 C = k;
				a1 = B > A;
				a2 = C == A;
				b1 = A > B;
				b2 = A > C;
				c1 = C > B;
				c2 = B > A;
			    if(A + a1 + a2 == B + b1 + b2 && B + b1 + b2 == C + c1 + c2)//??????????
		        {
					if(A > B && B > C)cout << "CBA";
					if(A > C && C > B)cout << "BCA";
					if(B > A && A > C)cout << "CAB";
					if(B > C && C > A)cout << "ACB";
					if(C > A && A > B)cout << "BAC";
					if(C > B && B > A)cout << "ABC";
				}
			}
		}
	 }

	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;
                                       if(B>A)shumu[1]++;
                                       if(A==C)shumu[1]++;//A??????? 
                                       if(A>B)shumu[2]++;
                                       if(A>C)shumu[2]++;//B??????? 
                                       if(C>B)shumu[3]++;
                                       if(B>A)shumu[3]++;//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++)shumu[i]=0;
                      }
    }
    for(i=1;i<=3;i++)cout<<pai[i];
    cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();
    return 0;
}
int main(void)
{
	int A,B,C;
	for(A=1;A<=3;A++)
		for(B=1;B<=3;B++)
			for(C=1;C<=3;C++)
			{
				if((A+(B>A)+(A==C)==3)&&(B+(A>B)+(A>C)==3)&&(C+(C>B)+(B>A)==3)&&((A-B)*(B-C)*(C-A)!=0))
				{
					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;
}
/**
* @file homework.cpp
* @author ??
* @date 2010?11?17
* @description
* ??????: ??? 
*/
int main()
{
	int a, b, c, l[3];                                //????                                            
	for (a=0;a<3;a++)
		for (b=0;b<3;b++)
			for (c=0;c<3;c++)                              //?? ??
			{
		       if (a!=b && b!=c && a!=c)
			   {
				   l[a] = (b > a) + (c == a);
				   l[b] = (a > b) + (a > c);
				   l[c] = (c > b) + (b > a);
				   if ((a + l[a])==2 && (b+l[b])==2 && (c+l[c])==2)
				   {  
					   if (a < b && b < c)
						   cout << "ABC";
					   if (a < c && c< b)
						   cout << "ACB";
					   if (b <a && a < c)
						   cout << "BAC";
					   if (b <c && c <a)
						   cout << "BCA";
					   if (c < a && a < b)
						   cout << "CAB";
					   if (c < b && b< a)
						   cout << "CBA";
				   }
			   }
			}
			return 0;
}
int main()
{
    int a,b,c,m[5]={0},i;char k[5]={'\0'};//cout<<m[3]<<"   "<<k[3]<<endl;
    for(a=0;a<3;a++)
         for(b=0;b<3;b++)
         {if(a==b) continue;
            for(c=0;c<3;c++)
            {
                if(a==c||b==c) continue;
                m[1]=b>a;
                m[2]=(a>b)+(a>c);
                m[3]=(c>b)+(b>a);
                if(m[1]>=m[2]&&a>b||m[1]<=m[2]&&a<b)  continue;
                if(m[2]>=m[3]&&b>c||m[2]<=m[3]&&b<c)  continue;
                if(m[1]>=m[3]&&a>c||m[1]<=m[3]&&a<c)  continue;
                k[a]='A';k[b]='B';k[c]='C';
                for(i=0;i<3;i++)
                cout<<k[i];
            }
        }
 
return 0;
}
int main()
{
    int A,B,C,a[3][2],i=0,j=0;
    for(A=0;A<3;A++)
        for(B=0;B<3;B++)
            for(C=0;C<3;C++)
            {
                if((A!=B)&&(B!=C)&&(A!=C))
                {
                    if((B>A)+(C==A)+A==2)
                    {
                        if((A>B)+(A>C)+B==2)
                        {
                            if((C>B)+(B>A)+C==2)
                            {
                                if(A==0&&B==1&&C==2)cout<<"ABC";
                                if(A==0&&B==2&&C==1)cout<<"ACB";
                                if(A==1&&B==0&&C==2)cout<<"BAC";
                                if(A==1&&B==2&&C==0)cout<<"CAB";
                                if(A==2&&B==1&&C==0)cout<<"CBA";
                                if(A==2&&B==0&&C==1)cout<<"BCA";
                            }
                              else continue;
                            }
                            else continue;
                        }
                        else continue;
                    }
                    else continue;
                }
        return 0;
    }
int main( )      //?????
{      //?????
int A,B,C;      //??3?????
int words[4];      //??3?????
char rank[4];
for(A=1;A<=3;A++){      //???????A
	for(B=1;B<=3;B++){      //???????B
		if(A==B) continue;
		for(C=1;C<=3;C++){      //???????C
			if(A==C||B==C) continue;
			words[1]=(B>A)+(A==C);      //A???
			words[2]=(A>B)+(A>C);      //B???
			words[3]=(C>B)+(B>A);      //C???
			//????????????????
			if(!(A<B&&words[1]<=words[2]||A<C&&words[1]<=words[3]||
			     B<A&&words[2]<=words[1]||B<C&&words[2]<=words[3]||
			     C<A&&words[3]<=words[1]||C<B&&words[3]<=words[2])){
                             //????????????
						 rank[A]='A';
						 rank[B]='B';
						 rank[C]='C';
						 cout <<rank[1] <<rank[2] <<rank[3]<<endl;
			}
		}
	}
}
return 0;      //???????????????????
}      //????
int main()
{
	int a,b,c;
	int d[3];
	char e[3];
	for(a=0;a<3;a++)
		for(b=0;b<3;b++)
			if(b!=a)
				for(c=0;c<3;c++)
					if(c!=a&&c!=b)
					{
						d[a]=(b>a)+(c==a)+a;
						d[b]=(a>b)+(a>c)+b;
						d[c]=(c>b)+(b>a)+c;
						if(d[a]==2&&d[b]==2&&d[c]==2)
						{
							e[a]='A';
							e[b]='B';
							e[c]='C';
							for(int i=0;i<=2;i++)
								cout<<e[i];
						}
					}
	return 0;		
}
//???????????
int main()
{
	int A=0,B=0,C=0,i=0,m[4];//????
	char a[4];
	for(i=1;i<=3;i++)//???????m[4]??????????????a[4]??????????
	{
		a[i]=0;
		m[i]=0;
	}
	for(A=1;A<=3;A++)//???????3????????????
	{
		for(B=1;B<=3;B++)
		{
			if(A==B) continue;//?????????
			for(C=1;C<=3;C++)
			{
				if(A==C||B==C) continue;
				m[1]=(B>A)+(C==A);//??????????
				m[2]=(A>B)+(A>C);
				m[3]=(C>B)+(B>A);
				if(m[1]==3-A&&m[2]==3-B&&m[3]==3-C)//?????????????????????2,1,0??
				{
					a[A]=65;//???A?????A??????????
					a[B]=66;
					a[C]=67;
				}
			}
		}
	}
	cout<<a[1]<<a[2]<<a[3];//???????
	return 0;
}
int main()
{
	int A, B, C, a, b, c, i, As, Bs, Cs;
	char s[3];
	for(A = 0; A < 3; A++)
		for(B = 0; B < 3; B++)
			for(C = 0; C < 3; C++)
			{
	                           As = (B > A) + (C == A);
	                           Bs = (A > B) + (A > C);
	                           Cs = (C > B) + (B > A);
				a = (A > B && As < Bs) || (A == B && As == Bs) || (A < B && As > Bs);
				b = (A > C && As < Cs) || (A == C && As == Cs) || (A < C && As > Cs);
				c = (B > C && Bs < Cs) || (B == C && Bs == Cs) || (B < C && Bs > Cs);
				if(a + b + c == 3)
				{
					s[A] = 'A';
					s[B] = 'B';
					s[C] = 'C';
					for(i = 0; i < 3; i++)
					{
						cout<<s[i];
					}
					cout<<endl;
				}
			}
			return 0;
}
/**
  *file  ???
  *author ???
  *date   11.17
  *function 3?????????????? 
			A??B??????C??????? 
			B??A??????A??C??? 
			C????B????B?A???? 
			????????????????????? 
			???????????3??????
*/
int main()
{
	int i = 0, j = 0, k = 0, a = 0, b = 0, c = 0, A, B, C;
	for(i = 0; i <= 2; i++)
	{
		for(j = 0; j <= 2; j++)
		{
			if(i == j)
			{
				continue;
			}
			else
			{
				for(k = 0; k <= 2; k++)
				{
					if(k == i || k == j)
					{
						continue;
					}
					else
					{
						A = i; B = j; C = k;
						a = (B > A) + (A == C);
						b = (A > B) + (A > C);
						c = (C > B) + (B > A);
						if(a + A == 2 && b + B == 2 && c + C == 2)
						{
							if(A > B > C)
							{
								cout << "CBA" << endl;
							}
							if(A > C > B)
							{
								cout << "BCA" << endl;
							}							
							if(B > A > C)
							{
								cout << "CAB" << endl;
							}							
							if(B > C > A)
							{
								cout << "ACB" << endl;
							}							
							if(C > B > A)
							{
								cout << "CBA" << endl;
							}							
							if(C > A > B)
							{
								cout << "BCA" << endl;
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a=0,b=0,c=0,k=0;
	int c1=0,c2=0,c3=0;
	for(a=1;a<4;a++)
		for(b=1;b<4;b++)
		{
			if(b!=a)
				for(c=1;c<4;c++)
				{
					if(c!=a&&c!=b)
					{
						c1=(b>a)+(a==c);
						c2=(a>b)+(a>c);
						c3=(c>b)+(b>a);
						if(a+c1==3&&b+c2==3&&c+c3==3)
						{
							for(k=1;k<4;k++)
							{
								if(a==k)
									cout <<"A";
								if(b==k)
									cout <<"B";
								if(c==k)
									cout <<"C";
							}
							cout <<endl;
							break;
						}
					}
				}
		}
	return 0;
}
int main()
{
	char w[3]={'A','B','C'},t;//???????????
	int a,b,c,sum1,sum2,sum3,k,i,j,q[3];
	
	for(a = 0;a < 3;a++)//???????????0,1,2
		for(b = 0;b < 3;b++)
			for(c = 0;c < 3;c++)
			{
				sum1 = (b>a)+(a == c);
				sum2 = (a > b)+(a > c);
				sum3 = (c > b)+(b > a);
				if(a + sum1 == b + sum2 && b + sum2 == c + sum3)//???????????????
				{
					q[0] = a;q[1] = b;q[2] = c;
					for(j = 0;j < 2;j++)//?????????????
					for(i = j;i < 2;i++)
						if(q[i] > q[i + 1])
						{k = q[i];q[i] = q[i+1];q[i + 1] = k;t = w[i];w[i] = w[i + 1];w[i + 1] = t;}//???????
					for(i = 0;i < 3;i++)
						cout << w[i];
					cout << 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(((b>a)+(c==a))==0)  //??A????????A????
    				 {
    					 cout<<"A";
    					 if((a>b)+(a>c)==1)//??B???????B????
    					 {
    						 cout<<"BC";
    					 }
    					 else
    					 {
    						 cout<<"CB";
    					 }
    					 return 0;
                     }
    				 				 if((a>b)+(a>c)==0)
    				 {
    					 cout<<"B";
    					 if((b>a)+(c==a)!=2)
    					 {
    						 cout<<"CA";
    					 }
    					 else
    					 {
    						 cout<<"AC";
    					 }
    					 return 0;

    				 }
    				 if(((c>b)+(b>a))==0)
    				 {
    					 cout<<"c";
    					 if((a>b)+(a>c)==1)
    					 {
    						 cout<<"BA";
    					 }
    					 else
    					 {
    						 cout<<"AB";
    					 }
    					 return 0;
    				 }

    			 }
    		 }
    	 }

    	}
    return 0;

}
int main()
{
    int a, b, c, o = 0;
    for(a = 1; a <= 3 && o < 1; a++){
        for(b = 1; b <= 3 && o < 1; b++){
            if( a == b ) 
                continue;
            for(c = 1; c <=3 && o < 1; c++){
                if(a == c || b == c)
                      continue;
  //              if(a == 3 && b == 1 && c == 2)
  //                  cout<<"herererere"<<endl;
                if( (a == 3 - (b > a) - (c == a) )
                     && ( b == 3 - (a > b) - (a > c) )
                     && ( c == 3 - (c > b) - (b > a) )
                )
                    o=1;
            }
        }
    }//?????????????????????????????????? 
    a=a-1;
    b=b-1;
    c=c-1;
    //cout<<o<<endl;
    if(a>b && b>c) 
        cout << "CBA";
    if(a>c && c>b) 
        cout << "BCA";
    if(b>a && a>c) 
        cout<<"CAB";
    if(b>c && c>a) 
        cout<<"ACB";
    if(c>b && b>a) 
        cout<<"ABC";
    if(c>a && a>b) 
        cout<<"BAC";
        
    return 0;
}
//******************************//
 //*     ?????				*//
 //*     ???1000012711		*//
 //*     ??????			*//
 //*     ???2010.11.17		*//
 //******************************// 
void judge(int, int, int);
int main()
{
	int a, b, c, g, cc11, cc12, cc21, cc22, cc31, cc32;
	g = 0;
	for (a = 1; a <= 3; a ++)
	{
		for (b = 1; b <= 3; b ++)
		{
			for (c = 1; c <= 3; c ++)
			{
				cc11 = (b > a);
				cc12 = (c == a);
				cc21 = (a > b);
				cc22 = (a > c);
				cc31 = (c > b);
				cc32 = (b > a);
				if ((cc11 + cc12 == 3 - a) && (cc21 + cc22 == 3 - b) && (cc31 + cc32 == 3 - c))
				{
					g = 1;
					break;
				}
			}
			if (g == 1)
				break;
		}
		if (g == 1)
			break;
	}
	judge(a, b, c);
	return 0;
}
void judge(int a,int b,int c)
{
	int i, j, n[4] = {0, a, b, c};
	for (i = 1; i <= 3; i ++)
	{
		for (j = 1; j <= 3; j ++)
		{
			if (n[j] == i)
			{
				cout << (char)(j + 64);
			}
		}
	}
	cout << endl;
}
/*
 * v.cpp
 *
 *  Created on: 2012-10-23
 *      Author: user
 */

int main()
{
	int a,b,c;
	int j,i;
	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&&(b<a)+(c<a)==2-b&&(c>b)+(b>a)==(2-c)) break;}
			if((b>a)+(c==a)==2-a&&(b<a)+(c<a)==2-b&&(c>b)+(b>a)==(2-c)) break;}
		if((b>a)+(c==a)==2-a&&(b<a)+(c<a)==2-b&&(c>b)+(b>a)==(2-c)) break;}
	char m[3],u;int n[3],t;
	m[0]='A';m[1]='B';m[2]='C';
	n[0]=a;n[1]=b;n[2]=c;
	for(j=0;j<2;j++)
		for(i=0;i<2-j;i++)
			if(n[i]>n[i+1])
			{t=n[i];n[i]=n[i+1];n[i+1]=t;
			u=m[i];m[i]=m[i+1];m[i+1]=u;}
	cout<<m[0]<<m[1]<<m[2];
	return 0;

}
/**
* @file 3.cpp
* @author ???
* @date 2011-10-15
* @description
* ??????: ??? 
*/
int main()
{
int eA, eB, eC, sA, sB, sC;
 // ????????????eA eB eC = 1, 2, 3?????
for(eA = 1; eA <= 3; eA++)
	for(eB = 1; eB <= 3; eB++)
		for(eC = 1; eC <= 3; eC++)
		{
		sA = (eB > eA) + (eC == eA);
		sB = (eA > eB) + (eA > eC);
		sC = (eC > eB) + (eB > eA);
		// ????????????????
                  if( sA + eA == 3 && sB + eB == 3 && sC + eC == 3
			&& eA != eB && eB != eC && eC != eA)
{ // ????
if(eA < eB && eB < eC) cout << "ABC" << endl;
if(eA < eC && eC < eB) cout << "ACB" << endl;
if(eB < eA && eA < eC) cout << "BAC" << endl;
if(eB < eC && eC < eA) cout << "BCA" << endl;
if(eC < eA && eA < eB) cout << "CAB" << endl;
if(eC < eB && eB < eA) cout << "CBA" << endl;
}
         }
return 0;
}
/*???:???
**?  ?:??
**?  ?:2010?11?23?
*/
int main()
{
	int A, B, C, i, j[3], r[3];
	char R[3] = {'A', 'B', 'C'};
	//???0,1,2??????,????????
	for (A = 0; A <= 2; A++)
		for (B = 0; B <= 2; B++)
			for (C = 0; C <= 2; C++)
			{
				r[0] = (B > A) + (C == A);//A?????
				r[1] = (A > B) + (A > C);//B?????
				r[2] = (C > B) + (B > A);//C?????
				j[0] = r[0] + A;//A??????A????
				j[1] = r[1] + B;//B??????B????
				j[2] = r[2] + C;//C??????C????
				//?????????,????????????2
				if (j[0] == 2 && j[1] == 2 && j[2] == 2)
				{
					for (i = 0; i <= 2; i++)
					{
						if (r[i] == 2)
							j[0] = i;
						if (r[i] == 1)
							j[1] = i;
						if (r[i] == 0)
							j[2] = i;
					}//??
					for (i = 0; i <= 2; i++)
						cout << R[j[i]];
					cout << endl;
				}	
			}
	return 0;
}
/*
 * 20.cpp
 *???
 *  Created on: 2012-10-17
 *      Author: ???
 */
int main()
{
	int a,b,c;
	for(a=1;a<=3;a++)
	{
		for(b=1;b<=3;b++)
			{
			for(c=1;c<=3;c++)
				{
					int sum1=(b>a)+(a==c),
						sum2=(a>b)+(a>c),
						sum3=(c>b)+(c>a);
					if(((sum1>sum2)&&(a<b)||(sum1<sum2)&&(a>b))&&((sum1>sum3)&&(a<c)||(sum1<sum3)&&(a>c))&&((sum2>sum3)&&(b<c)||(sum2<sum3)&&(b>c)))
					{
						if((sum1>sum2)&&(sum1>sum3))
							cout<<"A";
						if((sum2>sum3)&&(sum2>sum1))
							cout<<"B";
						if((sum3>sum2)&&(sum3>sum1))
							cout<<"C";
						if(((sum1>sum2)&&(sum3>sum1))||((sum1>sum3)&&(sum2>sum1)))
							cout<<"A";
						if(((sum2>sum1)&&(sum3>sum2))||((sum2>sum3)&&(sum1>sum2)))
							cout<<"B";
						if(((sum3>sum2)&&(sum1>sum3))||((sum3>sum1)&&(sum2>sum3)))
							cout<<"C";
						if((sum1<sum2)&&(sum1<sum3))
													cout<<"A";
						if((sum2<sum1)&&(sum2<sum3))
													cout<<"B";
						if((sum3<sum2)&&(sum3<sum1))
													cout<<"C";
					}

				}
			}
	}
}
int main()
{
	char A,B,C;
	int max1,min1,max2,min2;
	for (int i=0;i<3;i++)
	{
		for(int j=0;j<3;j++)
		{
			if(i==j)continue;
			for(int k=0;k<3;k++)
			{
				if(k==j||k==i)continue;
				int a[3]={0,0,0};
				if(j>i){a[0]=a[0]+1;a[2]=a[2]+1;}
				if(i>j)a[1]=a[1]+1;
				if(i>k)a[1]=a[1]+1;
				if(k>j)a[2]=a[2]+1;
				if(i==0)min1=0;
				if(j==0)min1=1;
				if(k==0)min1=2;
				if(i==2)max1=0;
				if(j==2)max1=1;
				if(k==2)max1=2;
				for(int l=0;l<3;l++)
				{
					if(a[l]==0)min2=l;
					if(a[l]==2)max2=l;
				}
				if(max1==min2&&min1==max2)
				{
					A=max1+65;
					B=min1+65;
					C=68-max1-min1;
					cout<<B<<C<<A;
				}
			}
		}
	}

    return 0;
}
typedef struct ABC {
	int amount;         // to store the amount they eat
	int statements;     // to store the number of the true statements
	char name;          // to store the name A, B, C
} ABC;


int main() {
	ABC p1, p2, p3;
	p1.name = 'A';
	p2.name = 'B';
	p3.name = 'C';
	for(p1.amount = 0; p1.amount < 3; p1.amount++) {
		for(p2.amount = 0; p2.amount < 3; p2.amount++) {
			for(p3.amount = 0; p3.amount < 3; p3.amount++)  {// use 0,1,2 to mean the amount they eat
				p1.statements = (p2.amount > p1.amount) + (p3.amount == p1.amount);  // to calculate the true statements
				p2.statements = (p1.amount > p2.amount) + (p1.amount > p3.amount);
				p3.statements = (p3.amount > p2.amount) + (p2.amount > p1.amount);
				int a, b, c;                            // to check whether they are in the right order
				a = (p1.amount > p2.amount && p1.statements < p2.statements) || (p1.amount < p2.amount && p1.statements > p2.statements);
				b = (p1.amount > p3.amount && p1.statements < p3.statements) || (p1.amount < p3.amount && p1.statements > p3.statements);
				c = (p3.amount > p2.amount && p3.statements < p2.statements) || (p3.amount < p2.amount && p3.statements > p2.statements);
				if(a + b + c == 3) {
					int temp1;  // the middle values used for switch the values
					char temp2;
					if(p1.amount > p2.amount) {      // give A,B,C a right order
						temp1 = p1.amount;
						p1.amount = p2.amount;
						p2.amount = temp1;
						temp2 = p1.name;
						p1.name = p2.name;
						p2.name = temp2;
					}
					if(p1.amount > p3.amount) {
						temp1 = p1.amount;
						p1.amount = p3.amount;
						p3.amount = temp1;
						temp2 = p1.name;
						p1.name = p3.name;
						p3.name = temp2;
					}
					if(p2.amount > p3.amount) {
						temp1 = p3.amount;
						p3.amount = p2.amount;
						p2.amount = temp1;
						temp2 = p3.name;
						p3.name = p2.name;
						p2.name = temp2;
					}
					cout << p1.name << p2.name << p3.name << endl;  // output
					
					return 0;
				}
				}
			
		}
	}
	return 0;
}