semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int sign[10];
int a,b,c,d,e;
void work()
{
     int t,flag=0;
     if(a==2)
     {
             t=1;
             a=1;
     }
     if(b==2)
     {
             t=2;
             b=1;
     }
     if(c==2)
     {
             t=3;
             c=1;
     }
     if(d==2)
     {
             t=4;
             d=1;
     }
     if(a==1&&sign[1]&&b==1&&sign[2]&&!flag){flag=1;}
     if(a==1&&sign[1]&&c==1&&sign[3]&&!flag){flag=1;}
     if(a==1&&sign[1]&&d==1&&sign[4]&&!flag){flag=1;}
     
     if(b==1&&sign[2]&&c==1&&sign[3]&&!flag){flag=1;}
     if(b==1&&sign[2]&&d==1&&sign[4]&&!flag){flag=1;}

     if(c==1&&sign[3]&&d==1&&sign[4]&&!flag){flag=1;}
     if(t==1)a=2;
     if(t==2)b=2;
     if(t==3)c=2;
     if(t==4)d=2;
     if(flag)
     {
                       cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
     }
}


     
             
int main()
{

    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=4;e<=5;e++)
                                                                         {
                                                                                          if(a==e||b==e||c==e||d==e)continue;
                                                                                          sign[1]=sign[2]=sign[3]=sign[4]=sign[5]=0;
                                                                                          sign[1]=e==1;
                                                                                          sign[2]=b==2;
                                                                                          sign[3]=a==5;
                                                                                          sign[4]=c!=1;
                                                                                          sign[5]=d==1;
                                                                                          if(sign[1]+sign[2]+sign[3]+sign[4]+sign[5]==2)
                                                                                          {
                                                                                          work();
                                                                                          /*cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;*/
                                                                                          }
                                                                         }
                                                        }
                                    }
                     }
    }
    return 0;
}
int main()
{
	int A,B,C,D,E;
	for(E = 1; E <= 5; E++)
	{
		for(A = 1; A < 6; A++)
		{
			for(B = 1; B < 6; B++)
			{
				for(C = 1; C < 6; C++)
				{
					for(D = 1; D < 6; D++)
					{
						int right[6] = {0};
						if(E == 1)
							right[A] = 1;
						if(B == 2)
							right[B] = 1;
						if(A == 5)
							right[C] = 1;
						if(C != 1)
							right[D] = 1;
						if(D == 1)
							right[E] = 1;
						if((E == 1) + (A == 5) + (B == 2) + (D == 1) + (C != 1) == 2
							&& A + B + C + D + E == 15 && A * B * C * D * E == 120 && right[1] == 1 && right[2] == 1
							&& E != 2 && E != 3)
							cout << A << " " << B << " " << C << " " << D << " " << E << endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int A,B,C,D,E;
	int a1,a2,a3,a4,a5;
	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==B||A==C||A==D||A==E||B==C||B==D||B==E||C==D||C==E||D==E||D==1) 
							continue;
					  a1=((E==1)&&(A==2));
					  a2=((B==2)&&(E!=3));
					  a3=((A==5)&&((C==1)||(C==2))&&(E!=2)&&(E!=3));
					  a4=((C!=1)&&((D==1)||(D==2))&&(E!=2)&&(E!=3));
					  a5=((D==1)&&(E==2)&&(E!=2)&&(E!=3));
					 
					  if(a1+a2+a3+a4+a5==2)
					  {
						  cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
						  break;
					  }
					}
	return 0;
}
int main()
{
	int a,b,c,d,e,flag=0;
	for(e=4;e<=5;e++)
	{
       for(a=3;a<=5;a++)
	   {
		   for(c=1;c<=2;c++)
		   {
			   for(b=1;b<=2;b++)
			   {
				   for(d=3;d<=5;d++)
				   {
					   if(e=4&&d!=4&&d!=5&&a!=4&&b!=1
						   &&a!=d&&c!=2)
					   {
						   
						   flag=1;
					   break;
					   }
					   if(flag==1)
						   break;
				   }
				   					   if(flag==1)
						   break;
			   }
			   					   if(flag==1)
						   break;
		   }
		   					   if(flag==1)
						   break;
	   }
	   					   if(flag==1)
						   break;
	}
						   
	e=4;
	cout <<a<<" "<<b<<" " <<c<< " " <<d<<" " <<e<<endl;
    return 0;
}
int b[10];
int main()
{
   int a[6];
   int cc[7];
   int i,j,count=0;
   for(a[1]=1;a[1]<6;a[1]++)
	    for(a[2]=1;a[2]<6;a[2]++)
			 for(a[3]=1;a[3]<6;a[3]++)
				  for(a[4]=1;a[4]<6;a[4]++)
					   for(a[5]=1;a[5]<6;a[5]++)
					   {
						   	    cc[1]=(a[1]==5);
                                cc[2]=(a[2]==2);
                                cc[3]=(a[5]==1);
                                cc[4]=(a[1]!=3);
                                cc[5]=(a[1]==4);
                                cc[6]=(a[1]!=a[2] && a[1]!=a[3] && a[1]!=a[4] && a[1]!=a[5] && a[2]!=a[3] && a[2]!=a[4] && a[2]!=a[5] && a[3]!=a[4] && a[3]!=a[5] && a[4]!=a[5]);
                            if(cc[a[1]]==1 && cc[a[2]]==1 && cc[a[3]]!=1 && cc[a[4]]!=1 && cc[a[5]]!=1 && cc[6]==1 && a[2]!=5 && a[3]!=5)
							{
								for(j=1;j<6;j++)
									for(i=1;i<6;i++)
									{
										if(a[i]==j&&count==0)
										{
											cout<<i;
											count++;
											break;
										}
										if(a[i]==j&&count==1)
											cout<<" "<<i;
									}	
								break;
							}
					   }
  
					   
  
   return 0;

}
main(){
int a,b,c,d,e,i;
i=0;
for(a=1;a<=5;a++){
for(b=1;b<=5;b++){
while(b==a)
b++;
if(b>=5)
break;
for(c=1;c<=5;c++){
while(c==a||c==b)
c++;
if(c>=5)
break;
for(d=1;d<=5;d++){
while(d==a||d==c||d==b)
d++;
if(d>=5)
break;
for(e=1;e<=5;e++){
while(d==e||e==b||e==a||e==c)
e++;
if(e>=5)
break;
if(e!=2&&e!=3&&(a==1||a==2)&&e==1&&(b==1||b==2)&&e==2){
printf("%d %d %d %d %d",a,b,c,d,e);
break;
}
if(e!=2&&e!=3&&(a==1||a==2)&&(c==1||c==2)&&a==5&&e==1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(a==1||a==2)&&(d==1||d==2)&&a!=5&&e==1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(a==1||a==2)&&(e==1||e==2)&&d==1&&e==1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(b==1||b==2)&&(c==1||c==2)&&b==2&&a==5){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(d==1||d==2)&&(b==1||b==2)&&c!=1&&b==2){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(b==1||b==2)&&(e==2||e==1)&&d==1&&b==2){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(c==1||c==2)&&(d==2||d==1)&&a==5&&c!=1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(c==1||c==2)&&(e==2||e==1)&&a==5&&d==1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}
if(e!=2&&e!=3&&(d==1||d==2)&&(e==2||e==1)&&c!=1&&d==1){
printf("%d %d %d %d %d",a,b,c,d,e);i=1;
break;}if(i==1) break;
}if(i==1) break;
}if(i==1) break;
}if(i==1) break;
}if(i==1) break;
}
}
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++)
			for(c=1; c<=5; c++)
				for(d=1; d<=5; d++)
					for(e=2; e<=3; e++)
					{
						as=(int)e==1;
						bs=(int)b==2;
						cs=(int)a==5;
						ds=(int)c!=1;
						es=(int)d==1;
						if((as==1&&bs==1&&a<c&&a<d&&a<e&&b<c&&b<d&&b<e||
							as==1&&cs==1&&a<b&&a<d&&a<e&&c<b&&c<d&&c<e||
							as==1&&ds==1&&a<b&&a<c&&a<e&&d<b&&d<c&&d<e||
							as==1&&es==1&&a<b&&a<c&&a<d&&e<b&&e<c&&e<d||
							bs==1&&cs==1&&b<a&&b<d&&b<e&&b<c&&b<d&&b<e||
							bs==1&&ds==1&&b<a&&b<c&&b<e&&d<a&&d<c&&d<e||
							bs==1&&es==1&&b<a&&b<c&&b<d&&e<a&&e<c&&e<d||
							cs==1&&ds==1&&c<a&&c<b&&c<e&&d<a&&d<b&&d<e||
							cs==1&&es==1&&c<a&&c<b&&c<d&&e<a&&e<b&&e<d||
							ds==1&&es==1&&d<a&&d<b&&d<c&&e<a&&e<b&&e<c)&&a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e&&a==5&&b==2)
							cout<<a<<" "<<b<<" "<<d<<" "<<e<<" "<<c<<endl;
					}
	return 0;
}
int main()
{
    int word[6]={0},a=0,b=0,c=0,d=0,e=0;//abcde????abcde????word??abcde???????  
    for(a=1;a<=5;a++)
    {
         for(b=1;b<=5;b++)   
         {
              if(b==a)
              continue;
                  for(c=1;c<=5;c++)
                  {
                      if(c==b)
                      continue;
                          for(d=1;d<=5;d++)
                          {
                              if(d==c)
                              continue;
                                  for(e=1;e<=5;e++)
                                  {
                                  if(e==d)
                                  continue;
                                  word[a]=(e==1);
                                  word[b]=(b==2);  
                                  word[c]=(a==5); 
                                  word[d]=(c!=1); 
                                  word[e]=(d==1);  
                                  if((word[1]==1)&&(word[2]==1)&&(word[3]==0)&&(word[4]==0)&&(word[5]==0)&&(e!=2)&&(e!=3))  
                                  {cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;goto loop;}  
                                  }     
                          }                 
                  }               
         }              
    }
loop:  return 0;
}
int main()
{
	int a,b,c,d,e;
	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++){
						int c1,c2,c3,c4,c5,c6,c7,c8,c9,c10;
						c1=(e==1);
						c2=(b==2);
						c3=(a==5);
						c4=(c!=1);
						c5=(d==1);
						c6=(a==1&&c1==1||a==2&&c1==1)||(a==3&&c1==0||a==4&&c1==0||a==5&&c1==0);
						c7=(b==1&&c2==1||b==2&&c2==1)||(b==3&&c2==0||b==4&&c2==0||b==5&&c2==0);
		                c8=(c==1&&c3==1||c==2&&c3==1)||(c==3&&c3==0||c==4&&c3==0||c==5&&c3==0);
		                c9=(d==1&&c4==1||d==2&&c4==1)||(d==3&&c4==0||d==4&&c4==0||d==5&&c4==0);
		                c10=(e==1&&c5==1||e==2&&c5==1)||(e==3&&c5==0||e==4&&c5==0||e==5&&c5==0);//?????????????
						if(a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e&&c6&&c7&&c8&&c9&&c10&&e!=2&&e!=3)//?????e?????
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
	return 0;
}
/*
 * mid2.cpp
 *
 *  Created on: 2013-11-8
 *      Author: b
 */
int main()
{
   int a,b,c,d,e;
   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;
					   if((c==1)&&(a==5)&&(b==2)&&((e==1)+(c!=1)+(d==1)==0))
					   cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
				    if((d==1)&&(b==2)&&((e==1)+(a==5)+(d==1)==0))
				    	cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
				    if((d==1)&&(c==2)&&(a==5)&&((e==1)+(b==2)+(d==1)==0))
				    	cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
					 //  if((e==1)+(b==2)+(a==5)+(c!=1)+(d==1)==2)&&
				   }
			   }
		   }
   }
}
int main()
{
    int rank[5];
    int i;
    int judge[6]={0};
    for(rank[0]=1;rank[0]<=5;rank[0]++)
       for(rank[1]=1;rank[1]<=5;rank[1]++)
          {if(rank[1]==rank[0])continue;
          for(rank[2]=1;rank[2]<=5;rank[2]++)
             {if(rank[2]==rank[1]||rank[2]==rank[0])continue;
             for(rank[3]=1;rank[3]<=5;rank[3]++)
             {if(rank[3]==rank[2]||rank[3]==rank[1]||rank[3]==rank[0])continue;
              rank[4]=15-rank[0]-rank[1]-rank[2]-rank[3];
              if(rank[4]==2||rank[4]==3)continue;
              else
              {
                  judge[rank[0]]=(rank[4]==1);
                  judge[rank[1]]=(rank[1]==2);
                  judge[rank[2]]=(rank[0]==5);
                  judge[rank[3]]=(rank[2]!=1);
                  judge[rank[4]]=(rank[3]==1);
                  if((judge[1]==1)&&(judge[2]==1)&&(judge[3]==0)&&(judge[4]==0)&&(judge[5]==0))
                  {for(i=0;i<4;i++)
                  {cout<<rank[i]<<" ";}
                  cout<<rank[4];}
              }
          }}}
    cin>>i;
    return 0;
}
int main()
{
	int f[6];
	int a[6],b[6];
	for(b[1] = 1; b[1] <= 5; b[1]++)
	{
		a[b[1]] = 'A';
		for(b[2] = 1;b[2] <=5;b[2]++)
		{
			if(b[2] == b[1])
				continue;
			a[b[2]] ='B';
			for(b[3] = 1;b[3] <=5;b[3]++)
			{
				if(b[3] == b[1] || b[3] == b[2])
					continue;
				a[b[3]] = 'C';
				for(b[4] = 1;b[4] <= 5; b[4] ++)
				{
					if(b[4] == b[1] || b[4] == b[2] || b[4] == b[3])
						continue;
					a[b[4]] = 'D';
					b[5] = 15 - b[1] -b[2] -b[3] - b[4];
					a[b[5]] ='E';
				    f[1] = a[1] == 'E';
					f[2] = a[2] == 'B';
					f[3] = a[5] == 'A';
					f[4] = a[1] != 'C';
					f[5] = a[1] == 'D';
					if(f[a[1] -'A'+1] == 1 && f[a[2] - 'A' +1] == 1 && f[a[3] - 'A' + 1] == 0 && f[a[4] - 'A' + 1] == 0 && f[a[5] - 'A'+1] == 0
						&& a[2] != 'E' && a[3] != 'E')
				    cout << b[1] <<" "<<b[2]<<" "<<b[3]<<" "<< b[4] <<" "<< b[5]<<endl;	
				}
			}
		}
	}
	return 0;
}
int main ()
{
	int a,b,c,d,e;
	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=4;e<=5;++e){
               if(a==1||a==2)
				   e=1;
			   if(b==1||b==2)
                   b=2;
			   if(c==1||c==2)
                   a=5;
			   if(d==1||d==2)
                   c!=1;
			   
		if((e==1)+(b==2)+(a==5)+(c!=1)+(d==1)==2&&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<<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
 int a[6],b[6],i,j;
 for(a[1]=1;a[1]<6;a[1]++)
 {
   for(a[2]=1;a[2]<6;a[2]++)
   {
     for(a[3]=1;a[3]<6;a[3]++)
	 {
	   for(a[4]=1;a[4]<6;a[4]++)
	   {
	    for(a[5]=1;a[5]<6;a[5]++)
		{
		if(a[5]!=2&&a[5]!=3)
		{
		  for(i=1;i<6;i++)
		  {
			  b[i]=(a[i]==1||a[i]==2);
		  }
		  if(a[1]!=a[2]&&a[1]!=a[3]&&a[1]!=a[4]&&a[1]!=a[5]&&a[2]!=a[3]&&a[2]!=a[4]&&a[2]!=a[5]&&a[3]!=a[4]&&a[3]!=a[5]&&a[4]!=a[5])
		  {
		  if(((b[1]-(a[5]==1))==0)&&((b[2]-(a[2]==2))==0)&&(b[3]-(a[1]==5))==0&&((b[4]-(a[3]!=1))==0)&&((b[5]-(a[4]==1))==0))
			  cout<<a[1]<<' '<<a[2]<<' '<<a[3]<<' '<<a[4]<<' '<<a[5];
		  }
		}
		   
		}
	   
	   }
	 }
   }
 }
return 0;
}
int main ()
{
	int a,b,c,d,e,x[6]={0},y[6]={0},i,j;

	for (a=1;a<=5;a++)
	{
		for (b=1;b<=5;b++)
		{
			if (a==b) 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) continue ;
						x[1]=a;
						x[2]=b;
						x[3]=c;
						x[4]=d;
						x[5]=e;
						y[1]=(e==1);
						y[2]=(b==2);
						y[3]=(a==5);
						y[4]=(c!=1);
						y[5]=(d==1);
						for (i=1;i<=5;i++)
						{
							for (j=i+1;j<=5;j++)
							{;
								if (y[i]+y[j]==2&&x[i]+x[j]==3)
								{
									if (y[1]+y[2]+y[3]+y[4]+y[5]==2&&x[5]!=2&&x[5]!=3)
									{
									     cout <<x[1]<<" "<<x[2]<<" "<<x[3]<<" "<<x[4]<<" "<<x[5]<<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)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;
						if(a==1||a==2)
						{
							if(e!=1)
							{
								continue;
							}
						}
						if(a!=1&&a!=2)
						{
							if(e==1)
							{
								continue;
							}
						}
						if(b==1||b==2)
						{
							if(b!=2)
							{
								continue;
							}
						}
						if(b!=1&&b!=2)
						{
							if(b==2)
							{
								continue;
							}
						}
						if(c==1||c==2)
						{
							if(a!=5)
							{
								continue;
							}
						}
						if(c!=1&&c!=2)
						{
							if(a==5)
							{
								continue;
							}
						}
						if(d==1||d==2)
						{
							if(c==1)
							{
								continue;
							}
						}
						if(d!=1&&d!=2)
						{
							if(c!=1)
							{
								continue;
							}
						}
						if(e==1||e==2)
						{
							if(d!=1)
							{
								continue;
							}
						}
						if(e!=1&&e!=2)
						{
							if(d==1)
							{
								continue;
							}
						}
						
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;


					}
				}
			}
		}

	}
	return 0;
}
int main()
{
	int factory[6];
	int rank[6];
	int flag[6];
	memset(flag,0,sizeof(flag));
	for(rank[1]=1;rank[1]<=5;rank[1]++)
		for(rank[2]=1;rank[2]<=5;rank[2]++)
			for(rank[3]=1;rank[3]<=5;rank[3]++)
				for(rank[4]=1;rank[4]<=5;rank[4]++)
					for(rank[5]=1;rank[5]<=5;rank[5]++)
					{
						if(rank[1]*rank[2]*rank[3]*rank[4]*rank[5]==120)
						{
							flag[1]=(rank[1]==5);
							flag[2]=(rank[2]==2);
							flag[3]=(rank[5]==1);
							flag[4]=(rank[1]!=3);
							flag[5]=(rank[1]==4);
							if(rank[1]==rank[2]||rank[2]==rank[3]||rank[3]==rank[4]||rank[4]==rank[5]||rank[5]==rank[1]) continue;
							if(flag[rank[1]]==1&&flag[rank[2]]==1&&flag[rank[3]]==0&&flag[rank[4]]==0&&flag[rank[5]]==0&&rank[2]!=5&&rank[3]!=5)
							{
								int i;
							    for(i=1;i<=5;i++) factory[rank[i]]=i;
								for(i=1;i<=4;i++)
									cout<<factory[i]<<" ";
cout<<factory[5];
							}
						}
					}





	return 0;
}
int main()
{
   int a,b,c,d,e,x[6],y[6];
   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!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e&&e!=3&&e!=2)
{
	y[a]=(e==1);
	y[b]=(b==2);
         y[c]=(a==5);
         y[d]=(c!=1);
	y[e]=(d==1);
	if(y[1]==1&&y[2]==1&&y[3]==0&&y[4]==0&&y[5]==0)
	cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;		
 }
   return 0;
}
int main()
{
	int a,b,c,d,e,w[6],rank[6];
	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*b*c*d*e==120&&a+b+c+d+e==15)
						{
							w[1]=(e==1);
							w[2]=(b==2);
							w[3]=(a==5);
							w[4]=(c!=1);
							w[5]=(d==1);
							rank[a]='A'-64;
							rank[b]='B'-64;
							rank[c]='C'-64;
							rank[d]='D'-64;
							rank[e]='E'-64;
							if (w[rank[1]]==1&&w[rank[2]]==1&&w[rank[3]]==0&&w[rank[4]]==0&&w[rank[5]]==0&&e!=2&&e!=3)
							{	
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
							}
						}
					}
					return 0;
}
int main()
{
	int A, B, C, D, E, i, j, k , m, l, p;
	char ci[6], T[6];
	for(i = 1 ; i <= 5 ; i ++)
	{
		A = i;
		ci[i] = 'A';
		for(j = 1 ; j <= 5 ; j ++)
		{
			if(A != j)
			{
				B = j;
			    ci[j] = 'B';
			    for(k = 1 ; k <= 5 ; k ++)
			    {
					if(A != k && B != k)
					{
						C = k;
						ci[k] = 'C';
						for(m = 1 ; m <= 5 ; m ++)
						{	
							if(m != A && m != B && m != C)
							{
								D = m;
								ci[m] = 'D';
								for(l = 1 ; l <= 5 ; l ++)
								{
									if(l != A && l != B && l != C && l != D && l != 2 && l != 3)
									{
										E = l;
										ci[l] = 'E';
										T[1] = (E == 1);
										T[2] = (B == 2);
										T[3] = (A == 5);
										T[4] = (C != 1);
										T[5] = (D == 1);
										if(T[ci[1] - 'A' + 1] == 1 && T[ci[2] - 'A' + 1] == 1 && T[ci[3] - 'A' + 1] == 0 && T[ci[4] - 'A' + 1] == 0 && T[ci[5] - 'A' + 1] == 0)
											cout << A << ' ' << B << ' ' << C << ' ' << D <<  ' ' << E << endl;;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	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++ )
		{
			for ( c = 1; c <= 5; c++ )
			{
				for ( d = 1; d <= 5; d++ )
				{
					for ( e = 1; e <= 5; e++ )
					{
						if ( a != b && a != c && a != d && a!= e && b != c && b != d && b != e && c != d && c != e && d != e && e != 2 && e != 3 )
						{
							A = ( e == 1 );
							B = ( b == 2 );
							C = ( a == 5 );
							D = ( c != 1 );
							E = ( d == 1 );
							if ( ( ( a == 1 && b == 2 ) || ( a == 2 && b == 1 ) ) && A == 1 && B == 1 && C == 0 && D == 0 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( a == 1 && c == 2 ) || ( a == 2 && c == 1 ) ) && A == 1 && B == 0 && C == 1 && D == 0 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( a == 1 && d == 2 ) || ( a == 2 && d == 1 ) ) && A == 1 && B == 0 && C == 0 && D == 1 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( a == 1 && e == 2 ) || ( a == 2 && e == 1 ) ) && A == 1 && B == 0 && C == 0 && D == 0 && E == 1 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( b == 1 && c == 2 ) || ( b == 2 && c == 1 ) ) && A == 0 && B == 1 && C == 1 && D == 0 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( b == 1 && d == 2 ) || ( b == 2 && d == 1 ) ) && A == 0 && B == 1 && C == 0 && D == 1 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( b == 1 && e == 2 ) || ( b == 2 && e == 1 ) ) && A == 0 && B == 1 && C == 0 && D == 0 && E == 1 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( c == 1 && d == 2 ) || ( c == 2 && d == 1 ) ) && A == 0 && B == 0 && C == 1 && D == 1 && E == 0 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( c == 1 && e == 2 ) || ( c == 2 && e == 1 ) ) && A == 0 && B == 0 && C == 1 && D == 0 && E == 1 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							if ( ( ( d == 1 && e == 2 ) || ( d == 2 && e == 1 ) ) && A == 0 && B == 0 && C == 0 && D == 1 && E == 1 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
						}
					}
				}
			}
		}
	}
}
/*
 * kongtiao.cpp
 *
 *  Created on: 2012-12-8
 *      Author: Lenovo
 */
int main()
{
	int rank[5],cc[5];
	int c = rank[1]+rank[2]+rank[3]+rank[4]+rank[0]==15&&rank[1]*rank[2]*rank[3]*rank[4]*rank[0]==120;
	int i,j,k;
	for(rank[0]=1;rank[0]<=5;rank[0]++)
		for(rank[1]=1;rank[1]<=5;rank[1]++)
			for(rank[2]=1;rank[2]<=5;rank[2]++)
				for(rank[3]=1;rank[3]<=5;rank[3]++)
					for(rank[4]=1;rank[4]<=5;rank[4]++)
					{
						if(rank[4]==2||rank[4]==3) continue;
						c = rank[1]+rank[2]+rank[3]+rank[4]+rank[0]==15&&rank[1]*rank[2]*rank[3]*rank[4]*rank[0]==120;
						cc[0] = rank[4]==1;
						cc[1] = rank[1]==2;
						cc[2] = rank[0]==5;
						cc[3] = rank[2]!=1;
						cc[4] = rank[3]==1;
						if(c==1&&cc[0]+cc[2]+cc[3]+cc[4]+cc[1]==2)
						{
							for(i=0;i<4;i++)
								for(j=i+1;j<5;j++)
								{
									if(rank[i]+rank[j]==3)
									{
										cc[i]=1;
										cc[j]=1;
										if(cc[0]+cc[1]+cc[2]+cc[3]+cc[4]==2)
										{
											cout<<rank[0];
											for(k=1;k<5;k++)
											{
												cout<<' '<<rank[k];
											}
										}
									}
								}
						}
					}
	return 0;
}