semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{int a,b,c,d,e,sa,sb,sc,sd,se;
for(a=1;a<=5;a++)
{for(b=1;b<=5;b++)
 {if(b==a)
	 continue;
    for(c=1;c<=5;c++)
      {if(c==a||c==b)                   //????
	continue;
 for(d=1;d<=5;d++)
 {if(d==a||d==b||d==c)
	 continue;
 for(e=1;e<=5;e++)
 {if(e==a||e==b||e==c||e==d||e==2||e==3)
 continue;
 sa=(e==1);sb=(b==2);sc=(a==5);sd=(c!=1);se=(d==1);  //?????
if(a<=2&&b<=2&&(sa+sb==2)&&(sa+sb+sc+sd+se==2))    //????????
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(a<=2&&c<=2&&(sa+sc==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(a<=2&&d<=2&&(sa+sd==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(a<=2&&e<=2&&(sa+se==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(b<=2&&c<=2&&(sc+sb==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(d<=2&&b<=2&&(sd+sb==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(e<=2&&b<=2&&(se+sb==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(c<=2&&d<=2&&(sc+sd==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(e<=2&&c<=2&&(sc+se==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
if(e<=2&&d<=2&&(se+sd==2)&&(sa+sb+sc+sd+se==2))
{ cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}}}}}}
return 0;}
int main()
{
	int a[6] = {0},b[6] = {0};//a??????b?????
	int i,flag = 1;
	int a1,a2,a3,a4;//????
	for (a1 = 1;a1 <= 5;a1++)
	{
		a[1] = a1;
		for (a2 = 1;a2 <= 5;a2++)
		{
			if (a2 == a1)
				continue;
			a[2] = a2;
			for (a3 = 1;a3 <= 5;a3++)
			{
				if (a3 == a1 || a3 == a2)
					continue;
				a[3] = a3;
				for (a4 = 1;a4 <= 5;a4++)
				{
					flag = 1;
					if (a4 == a1 || a4 == a2 || a4 == a3)
						continue;
					a[4] = a4;
					a[5] = 15 - a1 - a2 - a3 - a4;
					if (a[5] == a1 || a[5] == a2 || a[5] == a3 || a[5] == a4 || a[5] == 2 ||a[5] == 3)
						continue;
					b[1] = (a[5] == 1);
					b[2] = (a[2] == 2);
					b[3] = (a[1] == 5);
					b[4] = (a[3] != 1);
					b[5] = (a[4] == 1);
					for (i = 1;i <= 5;i++)
					{
						if (a[i] == 1 || a[i] == 2)
						{
							if (b[i] == 0)
								flag = 0;
						}
						else
							if (b[i] == 1)
								flag = 0;
					}
					if (flag == 1)
					{
						for (i = 1;i <= 4;i++)
							cout<<a[i]<<" ";
						cout<<a[5];
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int ta, tb, tc, td, te;
	for ( int a = 1; a <= 5; a = a + 1)
	{
		for ( int b = 1; b <= 5; b = b + 1)
		{
			for ( int c = 1; c <= 5; c = c + 1)
			{
				for ( int d = 1; d <= 5; d = d + 1)
				{
					for ( int e = 1; e <= 5; e = e + 1)
					{
						if ( ( a != b) && ( a != c) && ( a != d) && ( a != e) && ( b != c) && ( b != d) && ( b != e) && ( c != d) && ( c != e) && ( d != e))
						{
							if ( ( e != 2) && ( e != 3))
							{
								ta = ( e == 1);
								tb = ( b == 2);
								tc = ( a == 5);
								td = ( c != 1);
								te = ( d == 1);
								if ( (ta + tb + tc + td + te) == 2)
								{
									if ( ( (a >= 1) && (a <= 2) && (ta == 1)) || ( ( a >= 3) && ( a <= 5) && ( ta == 0)))
									{
										if ( ( (b >= 1) && (b <= 2) && (tb == 1)) || ( ( b >= 3) && ( b <= 5) && ( tb == 0)))
                                        {
											if ( ( (c >= 1) && (c <= 2) && (tc == 1)) || ( ( c >= 3) && ( c <= 5) && ( tc == 0)))
											{
												if ( ( (d >= 1) && (d <= 2) && (td == 1)) || ( ( d >= 3) && ( d <= 5) && ( td == 0)))
												{
													if ( ( (e >= 1) && (e <= 2) && (te == 1)) || ( ( e >= 3) && ( e <= 5) && ( te == 0)))
													{
														cout << a << " " << b << " " << c << " " << d << " " << e << endl;
														break;
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
struct air
{
	int rank;
	int check;
};
int checka(int E)
{
	if(E==1)
	{return 1;}
	else
	{return 0;}
}

int checkb(int B)
{
	if(B==2)
	{return 1;}
	else
	{return 0;}
}

int checkc(int A)
{
	if(A==5)
	{return 1;}
	else
	{return 0;}
}
int checkd(int C)
{
	if(C!=1)
	{return 1;}
	else
	{return 0;}
}
int checke(int D)
{
	if(D==1)
	{return 1;}
	else
	{return 0;}
}

int main(void)
{
	struct air p[5];
	
	for(int a=1;a<6;a++)
	{
		for(int b=1;b<6;b++)
		{
			if(b==a){continue;}
			for(int c=1;c<6;c++)
			{
				if(c==a||c==b){continue;}
				for(int d=1;d<6;d++)
				{
					if(d==a||d==b||d==c){continue;}
					for(int e=1;e<6;e++)
					{
						if(e==a||e==b||e==c||e==d||e==2||e==3){continue;}
						int Check=1;
						p[0].rank=a;p[1].rank=b;p[2].rank=c;p[3].rank=d;p[4].rank=e;
						p[0].check=checka(p[4].rank);
						p[1].check=checkb(p[1].rank);
						p[2].check=checkc(p[0].rank);
						p[3].check=checkd(p[2].rank);
						p[4].check=checke(p[3].rank);
						for(int u=0;u<5;u++)
						{
							if(	((p[u].rank!=1&&p[u].rank!=2)&&(p[u].check==1)) ||((p[u].rank==1||p[u].rank==2)&&(p[u].check==0)))
							{Check=0;break;}
						}
						if(Check==1)
						{
							printf("%d",p[0]);
							for(int i=1;i<5;i++)
							{
								printf(" %d",p[i].rank);
							}
						}
					}
				}
			}
		}
	}

	return 0;
}
//int get(int x)
//{
  //  if(x==1) return A==5;
  //  if(x==2) return B==2;
  //  if(x==3) return E==1;
  //  if(x==4) return A!=3;
  //  if(x==5) return A==4;
//}
int main()

{
    int A, B, C, D, E, count=0;
    for(A=1; A<=5; A++)
      {
        for(B=1; B<=5; B++)
          {
            for(C=1; C<=5; C++)
              {
                for(D=1; D<=5; D++)
                  {
                    for(E=1; E<=5; E++)
                      {
                        //if(A==3&&B==2&&C==4&&D==5&&E==1)
                          //E++,E--;
                        if( (A!=B) && (A!=C) && (A!=D) && (A!=E) && (C!=B) && (D!=B) && (E!=B) && (C!=D) && (C!=E) && (D!=E) &&(E!=2) && (E!=3) && ((A<=2)^(E==1)==0) && ((B<=2)^(B==2)==0) &&((C<=2)^(A==5)==0) && ((D<=2)^(C>=2)==0) && ((E<=2)^(D==1)==0) )
                          {
                            //if((get(A))&&(get(B))&&(!get(C))&&(!get(D))&&(!get(E)))
                            if((A<=2)^(E==1)==0)
                            {if((E==1)==1)
                              count=count+1;}
                            
                            if((B<=2)^(B==2)==0)
                            {if((B<=2)==1)
                              count=count+1;}
                            
                            if((C<=2)^(A==5)==0)
                            {if((C<=2)==1)
                              count=count+1;}
                          
                            if((D<=2)^(C>=2)==0)
                            {if((C>=2)==1)
                              count=count+1;}
                            
                            if((E<=2)^(D==1)==0)
                            {if((D==1)==1)
                              count=count+1;}
                           
                             if(count==2)
                              {
                                cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E;        
                              }
                          }
                                              
                      }
                  }
              }  
          }     
      }
    int x;cin>>x;
    return 0;  
    
}
//**********************************
//???????
//???2013.11.5
//**********************************
int main()
{
	int a=0,b=0,c=0,d=0,e=0,i=0,k[6],p[6],j=0;
	for(k[5]=1;k[5]<=5;k[5]++)
	{
		if(k[5]==2||k[5]==3)
		   continue;
		for(k[1]=1;k[1]<=5;k[1]++)
		{
			if(k[1]==k[5])
				continue;
			for(k[2]=1;k[2]<=5;k[2]++)
			{
				if(k[2]==k[1]||k[2]==k[5])
					continue;
				for(k[3]=1;k[3]<=5;k[3]++)
				{
					if(k[3]==k[5]||k[3]==k[1]||k[3]==k[2])
						continue;
					k[4]=15-k[1]-k[2]-k[3]-k[5];
					p[1]=(k[5]==1);
					p[2]=(k[2]==2);
					p[3]=(k[1]==5);
					p[4]=(k[3]!=1);
					p[5]=(k[4]==1);
					j=0;
				       for(i=1;i<=5;i++)
					 { 
					     if(p[i]==1)
							 if((k[i]==1)||(k[i]==2))
							        j++;
						 if(p[i]==0)
							 if((k[i]==3)||(k[i]==4)||(k[i]==5))
								     j++;
					   }
					 if(j==5)
						 cout<<k[1]<<" "
					         <<k[2]<<" "
							 <<k[3]<<" "
						     <<k[4]<<" "
							 <<k[5]<<endl;
				}
			}
		}
	}
		return 0;
}
int main()
{
    int A,B,C,D,E;
	int a,b,c,d,e,x,y;
	for(A=1;A<=5;A++)
		for(B=1;B<=5;B++)
			for(C=1;C<=5;C++)
				for(D=1;D<=5;D++)
					for(E=1;E<=5;E++)
					{
						x=(((A-B)*(B-C)*(C-D)*(D-E)*(E-A)*(A-C)*(A-D)*(B-D)*(B-E)*(C-E))!=0);
						y=((E!=2)&&(E!=3));
						a=(E==1);
						b=(B==2);
						c=(A==5);
						d=(C!=1);
						e=(D==1);
						if(((A*a+B*b+C*c+D*d+E*e)==3)&&(((A-a)*(B-b)*(C-c)*(D-d)*(E-e))==0)&&x&&y)
							{cout<< A << ' '<<B<<' ' <<C<<' ' << D <<' ' <<E<<endl;
						
						}


					}
    return 0;
}
main()
{
      int a,b,c,d,e,count;
      for(e=1;e<=5;e++)
      {
         if(e==2||e==3)
         {
           continue;
         }
         for (a=1;a<=5;a++)
         {
             for(b=1;b<=5;b++)
             {
                for(c=1;c<=5;c++)
                {
                     for(d=1;d<=5;d++)
                     {
                          if (a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e)
                          {
                                      count=0;
                                      if((a==1||a==2)&&e==1)
                                      {     
                                          count++;
                                      }
                                      if (a!=1&&a!=2&&e!=1)
                                      {
                                          count++;
                                      }
                                      if (b!=1)
                                      {           
                                          count++;
                                      }
                                      if ((c==1||c==2)&&a==5)
                                      {
                                           count++;
                                      }
                                      if (c!=1&&c!=2&&a!=5)
                                      {
                                            count++;
                                      }
                                      if((d==1||d==2)&&c!=1)
                                      {
                                             count++;
                                      }
                                      if (d!=1&&d!=2&&c==1)
                                      {
                                           count++;
                                      }
                                      if ((e==1||e==2)&&d==1)
                                      {
                                           count++;
                                      }
                                      if (e!=1&&e!=2&&d!=1)
                                      {
                                            count++;
                                      }
                                      if (count==5)
                                      {
                                                   printf("%d %d %d %d %d\n",a,b,c,d,e);
                                      }
                          }
                     }
                }
             }
         }  
      }
getchar();getchar();getchar();getchar();
}
int main ()
{
	int a,b,c,d,e,cc1,cc2,cc3,cc4,cc5;
	for(a=1;a<=5;a++)
	{
		for(b=1;b<=5;b++)
		{
			if(b==a) continue;
			for(c=1;c<=5;c++)
			{
				if(c==a||c==b) continue ;
				for(d=1;d<=5;d++)
				{
					if(d==a||d==b||d==c) continue;
					e=15-a-b-c-d;
					cc1=(e==1);
					cc2=(b==2);
					cc3=(a==5);
					cc4=(c!=1);
					cc5=(d==1);
					if((((a<=2&&cc1==1)||(a>=3&&cc1==0))+((b<=2&&cc2==1)||(b>=3&&cc2==0))+((c<=2&&cc3==1)||(c>=3&&cc3==0))+((d<=2&&cc4==1)||(d>=3&&cc4==0))+((e<=2&&cc5==1)||(e>=3&&cc5==0)))==5)
						if(e!=2&&e!=3)
							cout << a<<' '<< b<<' '<< c<<' '<< d<<' '<<e<<endl;
				}
			}
		}
	}
	return 0 ;
}
int main()
{
	int words[6],rank[6];
	int A,B,C,D,E;
	for(A=1;A<=5;A++)
	{
	
		for(B=1;B<=5;B++)
		{
			if(A==B)
				continue;
			for(C=1;C<=5;C++)
			{
				if(A==C||B==C)
					continue;
				for(D=1;D<=5;D++)
				{
					if(A==D||B==D||C==D)
						continue;
					for(E=1;E<=5;E++)
					{
						if(A==E||B==E||C==E||D==E)
							continue;
						words[A]=(E==1);
						words[B]=(B==2);
						words[C]=(A==5);
						words[D]=(C!=1);
						words[E]=(D==1);
						rank[A]=A;
						rank[B]=B;
						rank[C]=C;
						rank[D]=D;
						rank[E]=E;
						if(words[rank[1]]==1&&words[rank[2]]==1&&words[rank[3]]==0&&words[rank[4]]==0&&words[rank[5]]==0&&E!=2&&E!=3)
							cout<<rank[A]<<" "<<rank[B]<<" "<<rank[C]<<" "<<rank[D]<<" "<<rank[E];
					}
				}
			}
		}
	}
		
	cout<<endl;
	
	return 0;
}
const int MAXN=6;
int a[MAXN]={0,1,2,3,4,5};
int main(){
	do{
        if(a[5]==2||a[5]==3)continue;
        if((a[1]==1||a[1]==2)&&a[5]!=1)continue;
		if(a[1]!=1&&a[1]!=2&&a[5]==1)continue;
		if(a[2]==1)continue;
		if((a[3]==1||a[3]==2)&&a[1]!=5)continue;
		if(a[3]!=1&&a[3]!=2&&a[1]==5)continue;
		if((a[4]==1||a[4]==2)&&a[3]==1)continue;
		if(a[4]!=1&&a[4]!=2&&a[3]!=1)continue;
		if((a[5]==1||a[5]==2)&&a[4]!=1)continue;
		if(a[5]!=1&&a[5]!=2&&a[4]==1)continue;
		for(int i=1;i<5;i++){
			cout<<a[i]<<' ';
		}
		cout<<a[5];
		return 0;
	}while(next_permutation(a+1,a+6));
	return 0;
}
/*
  Name: ????
  Copyright: 
  Author: 
  Date: 10/11/12 15:50
  Description: ??????????5???????????????????????5??????????E????????2???3?? 
A???????E??????? 
B????????????????? 
C???????A???????? 
D???????C????????? 
E???????D?????????? 
????????????????????????????????????A?B?C?D?E?????? 
???????????A?B?C?D?E??????????????????? 
*/
int main()
{
   int a,b,c,d,e;
   int w[6]={0};
   for(a=1;a<6;a++)
   {
      for(b=1;b<6;b++)
      {
         if(b==a)
             continue;
         else
         {
            for(c=1;c<6;c++)
            {
               if(a==c||b==c)
                  continue;
               else
                  for(d=1;d<6;d++)
                  {
                     if(d==a||d==b||d==c)
                        continue;
                     else
                     {
                        e=15-a-b-c-d;
                        w[a]=(e==1);
                        w[b]=(b==2);
                        w[c]=(a==5);
                        w[d]=(c!=1);
                        w[e]=(d==1);
                        if(w[1]+w[2]==2&&e!=2&&e!=3&&w[3]+w[4]+w[5]==0)
                           cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;    
                     }                
                  }             
            }    
         }                
      }                
   }

   return 0;       
}
int main() {
	int a=0,b=0,c=0,d=0,e=0,A=0,B=0,C=0,D=0,E=0;//?????????????????????????
	
	for(a=1;a<=5;a++)
		for(b=1;b<=5;b++)
			for(c=1;c<=5;c++)
				for(d=1;d<=5;d++)
					for(e=1;e<=5;e++)
					{
					if((e==2)||(e==3)) continue;//??e???2??3
					if((a==b)||(a==c)||(a==d)||(a==e)||(b==c)||(b==d)||(b==e)||(c==d)||(c==e)||(d==e)) continue;
					//?????????????
					A=(e==1);
					B=(b==2);
					C=(a==5);
					D=(c!=1);
					E=(d==1);
					if((A+B+C+D+E)!=2) continue;//?????2????????
					if((a*A+b*B+c*C+d*D+e*E)==3) {cout <<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;return 0;}//??????????????? ?????1??????????3
					}
	return 0;
}
int main()
{
    int A,B,C,D,E;
    int As,Bs,Cs,Ds,Es;
    for(A=1;A<=5;A++)
    {
        for(B=1;B<=5;B++)
        {
            if(A==B)
            continue;
            for(C=1;C<=5;C++)
            {
                if(A==C||B==C)
                continue;
                for(E=1;E<=5;E++)
                {
                    
                    if(A==E||B==E||C==E||E==2||E==3)
                    continue;
                    else
                    D=15-A-B-C-E;
                 As=(E==1);
                 Bs=(B==2);
                 Cs=(A==5);
                 Ds=(C!=1);
                 Es=(D==1);
                 if(A+B==3&&As==1&&Bs==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(A+C==3&&As==1&&Cs==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(A+D==3&&As==1&&Ds==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(A+E==3&&As==1&&Es==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(B+C==3&&Bs==1&&Cs==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(B+D==3&&Bs==1&&Ds==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(B+E==3&&Bs==1&&Es==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(C+D==3&&Cs==1&&Ds==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(C+E==3&&Cs==1&&Es==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
                 if(D+E==3&&Ds==1&&Es==1)
                 cout <<A<<" "<<B<<" "<<C<<" "<<D<<" "<< E << endl;
            break;
                }
     
         }
   
    }

}  

return 0;
}
int main()

{
	for(int a = 1; a <= 5; a++)
	{
		for(int b = 1; b <= 5; b++)
		{
			for(int c = 1; c <= 5; c++)
			{
				for(int d = 1; d <= 5; d++)
				{
					for(int e = 1; e <= 5; e++)
					{
						int ta, tb, tc, td, te, t;
						ta = (e == 1);
						tb = (b == 2);
						tc = (a == 5);
						td = (c != 1);
						te = (d == 1); //??? 
						t = (e != 2) + (e != 3);
						if((((t == 2 && ta == 1 && tb == 1 && tc == 0 && td == 0 && te == 0) && (((a == 1) && (b == 2)) || ((a == 2) && (b == 1)))) || 
						((t == 2 && ta == 1 && tc == 1 && tb == 0 && td == 0 && te == 0) && (((a == 1) && (c == 2)) || ((a == 2) && (c == 1)))) ||
						(t == 2 && ta == 1 && td == 1 && tc == 0 && tb == 0 && te == 0 && (((a == 1) && (d == 2)) || ((a == 2) && (d == 1)))) ||
						(t == 2 && tb == 1 && tc == 1 && ta == 0 && td == 0 && te == 0 && (((b == 1) && (c == 2)) || ((b == 2) && (c == 1)))) ||
						(t == 2 && tb == 1 && td == 1 && tc == 0 && ta == 0 && te == 0 && (((b == 1) && (d == 2)) || ((b == 2) && (d == 1)))) ||
						(t == 2 && tc == 1 && td == 1 && ta == 0 && tb == 0 && te == 0 && (((c == 1) && (d == 2)) || ((c == 2) && (d == 1))))) &&
						((a != b) && (a != c) && (a != d) && (a != e) &&
						(b != c) && (b != d) && (b != e) &&
						(c != d) && (c != e) && (d != e)))
							cout << a << " " << b << " " << c << " " << d << " " << e;
					}
				}
			}
		}
	}
	return 0;
}
/*
 * h040_kongtiaopaiming.cpp
 * name:????
 *  Created on: 2011-11-8
 *      Author: zhujile
 */
int main(){
	int a,b,c,d,e;      //a~e?????
	for (e=1;e<=5;e++)  //????????
	{
		if (e==2||e==3) continue; //??????e???????
		for (a=1;a<=5;a++)
		{
			if (a==e) continue;   //??????
		    for (b=1;b<=5;b++)
		    {
		    	if (b==a||b==e) continue; //??????
		    	for (c=1;c<=5;c++)
		    	{
		    		if (c==a||c==b||c==e) continue; //??????
		    		for (d=1;d<=5;d++)
		    		{
		    			if (d==a||d==b||d==c||d==e) continue; //??????
		    			if (a>2&&e==1) continue;              //???????????????
		    			if (b>2&&b==2) continue;              //???????????????
		    			if (c>2&&a==5) continue;              //???????????????
		    			if (d>2&&c!=1) continue;              //???????????????
		    			if (e>2&&d==1) continue;              //???????????????
		    			if (((a<3&&e==1)+(b<3&&b==2)+(c<3&&a==5)+(d<3&&c!=1)+(e<3&&d==1))!=2) continue;
		    			                                      //??????????
		    			cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl; //?????????
		    			a=b=c=d=e=6;                          //?????????
		    		}
		    	}
		    }
		}
	}
	return 0;
}
int main()
{
	int A=1,B=1,C=1,D=1,E=1;
	if(A==1||A==2)
	{
		A=2;
		E=1;
		D=1;
	}
	if(B==1||B==2)
	{
		B=2;
		if(C==1)
		{
			C=1;
			A=5;
			E=4;
			D=3;
			cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
		}
		if(D==1)
		{
			D=1;
			E=2;
		}
		if(E==1)
		{
			E=1;
			D=1;
		}		
	}
	if(C==1||C==2)
	{
		A=5;
		C=2;
		if(D==1)
		{
			D=1;
			E=1;
		}
		if(E==1)
		{
			E=1;
			D=1;
		}
	}
	if(D==1||D==2)
	{
		C!=1;
		if(E==1)
		{
			E=1;
			D=1;
		}
	}
	return 0;
}
int main()
{
	int A, B, C, D, E;                                                                                                                                                                                                   
	int a, b, c, d, e;
	for(A = 1;A <= 5; A++)
		for(B = 1;B <= 5; B++)
		{
			if (A == B)
				continue;
			for(C = 1;C <= 5; C++)
			{
				if (C == B || C == A)
					continue;
				for(D = 1;D <= 5; D++)
				{
					if (D == B || D == A || D == C)
						continue;
					for(E = 1;E <= 5; E++)
					{
						if (E == B || E == A || E == C || E == D || E == 2 || E == 3 )
							continue;
						a = (E == 1);
						b = (B == 2);
						c = (A == 5);
						e = (D == 1);
						d = (C != 1);
						if (a + b + c + d + e == 2 && A*a + B*b + C*c + D*d + E*e == 3)
						{
							cout << A << " " << B << " " << C << " " << D <<" " << E << endl;
							break;
						}
					}
				}
			}
		}
		return 0;
}
int main()
{
	int A,B,C,D,E,a[6];
	for(A=1;A<=5;A++)
		for(B=1;B<=5;B++)
		{
			if(A==B) continue;           //???????
			for(C=1;C<=5;C++)
			{
				if(A==C||B==C) continue;
				for(D=1;D<=5;D++)
				{
					if(A==D||B==D||C==D) continue;
					for(E=1;E<=5;E++)
					{
						if(A==E||B==E||C==E||D==E) continue;
						if(E==2||E==3) continue;
						a[A]=(E==1);
						a[B]=(B==2);
						a[C]=(A==5);
						a[D]=(C!=1);
						a[E]=(D==1);
						if(a[1]==1&&a[2]==1&&a[3]==0&&a[4]==0&&a[5]==0)         //??????????????????????
							cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
					}
				}
			}
		}
	return 0;
}
int main()
{
	int a, b, c, d, e, f[10];
	for(int a = 1; a <= 5; a++)
	{
		for(int b = 1; b <= 5; b++)
		{
			for(int c = 1; c <= 5; c++)
			{
				for(int d = 1; d <= 5; d++)
				{
					for(int e = 1; e <= 5; e++)
					{
						f[a] = (e == 1);
						f[b] = (b == 2);
						f[c] = (a == 5);
						f[d] = (c != 1);
						f[e] = (d == 1);						
						if((e != 2)&&(e != 3)&&(f[1] == 1)&&(f[2] == 1)&&(f[3] == 0)&&(f[4] == 0)&&(f[5] == 0)
						&&(a != b)&&(a != c)&&(a != d)&&(a != e)&&(b != c)&&(b != d)&&(b != e)&&(c != d)&&(c != e)&&(d != e))
						{
							printf("%d %d %d %d %d\n", a, b, c, d, e);
						}
					}
				}
			}
		}
	}
  return 0;
}
/*
 * zhizhenlianxi.cpp
 *
 *  Created on: 2012-12-4
 *      Author: wenjun
 */
int main ()
{
	int a,b,c,d,e;
	int words[10],rank[10];
	for(a=1;a<=5;a++)
	{
		for(b=1;b<=5;b++)
		{if(a==b) continue;
			for(c=1;c<=5;c++)
			{
			if(a==c||b==c) continue;
				for(d=1;d<=5;d++)
				{
				if(a== d || b == d|| c == d) continue;
					for(e=1;e<=5;e++)
					{
						//cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
						if(e==2||e==3) continue;
						if(a+b+c+d+e==15&&a*b*c*d*e==120){
							//cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
						words[1]=(e==1);
						words[2]=(b==2);
						words[3]=(a==5);
						words[4]=(c!=1);
						words[5]=(d==1);
						rank[a]=1;rank[b]=2;rank[c]=3;rank[d]=4;rank[e]=5;
						if(words[rank[1]]==1&&words[rank[2]]==1&&words[rank[3]]==0&&words[rank[4]]==0&&words[rank[5]]==0)
						{
							//for(int i = 1; i <= 5; i++)
						        //cout<<"Rank "<<i<<": Player "<<char(rank[i]+64)<<endl;
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
						}
					}}}}}}
	return 0;
}
int main() //?????
{
 int a,b,c,d,e;
 for(a=1;a<=5;a++)
   for(b=1;b<=5;b++)
     if(a!=b)
       for(c=1;c<=5;c++)
         if(c!=a&&c!=b)
           for(d=1;d<=5;d++)
             if(d!=a&&d!=b&&d!=c)
               for(e=1;e<=5;e++)
                 if(e!=a&&e!=b&&e!=c&&e!=d) //??abcde?1?5??
                   if(e!=2&&e!=3)
                     {int s[5];
                      s[a-1]=(e==1);
                      s[b-1]=(b==2);
                      s[c-1]=(a==5);
                      s[d-1]=(c!=1);
                      s[e-1]=(d==1); //????????????
                      if(s[0]+s[1]==2&&s[2]+s[3]+s[4]==0)
                        cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
 return 0;
} //????