semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
main()
{
  int rights=0;
   int p[5];
  /* int A[5]={0,0,0,0,0};
   int B[5]={0,2,0,0,0};
   int C[5]={5,0,0,0,0};
   int D[5]={0,0,6,0,0};
   int E[5]={0,0,0,1,0};
   
   for(int k=0;k<5;k++)
   {if(p[k]==1)
   for(int i=1;1<5;i++)
   {
     for(int j=i;j<5;j++)
     { if( A[j]==p[i]&&p[i]!=0)
       rights++;
       if( B[j]==p[i]&&p[i]!=0)
       rights++;
       if( C[j]==p[i]&&p[i]!=0)
       rights++;
       if( D[j]==p[i]&&p[i]!=0)
       rights++;
       if( E[j]==p[i]&&p[i]!=0)
       rights++;
       }      
           }
   }*/
   p[0]=5;
   p[1]=2;
   p[2]=1;
   p[3]=3;
   p[4]=4;
    printf("%d %d %d %d %d",p[0],p[1],p[2],p[3],p[4]);

   }
/*
 * ????????? 
 * ?????2011-11-6
 * ?????
 * ?????????????
 */
int main()
{
    int a,b,c,d,e,A,B,C,D,E;                          //????
    for(a=1;a<=5;a++)                                 //??a-e???
    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||e==2||e==3)
    	continue;
    A=(e==1);                                         
    B=(b==2);
    C=(a==5);
    D=(c!=1);
    E=(d==1);
    if(A+B+C+D+E==2)                                //???????
    {if((A==1&&a==1&&B==1&&b==2)||(B==1&&b==1&&A==1&&a==2)||(A==1&&a==1&&C==1&&c==2)||(C==1&&c==1&&A==1&&a==2)||(A==1&&a==1&&D==1&&d==2)||(D==1&&d==1&&A==1&&a==2)||(E==1&&e==1&&A==1&&a==2)||(B==1&&b==1&&C==1&&c==2)||(C==1&&c==1&&B==1&&b==2)||(B==1&&b==1&&D==1&&d==2)||(D==1&&d==1&&B==1&&b==2)||(E==1&&e==1&&B==1&&b==2)||(C==1&&c==1&&D==1&&d==2)||(D==1&&d==1&&C==1&&c==2)||(E==1&&e==1&&C==1&&c==2)||(E==1&&e==1&&D==1&&d==2))//???????????
     cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;      //???????
    }
    }
    }
    }
    }

	return 0;
}
/*
 * wanyi.cpp
 *
 *  Created on: 2012-11-8
 *      Author: 7
 */
int main()
{
	int a,b,c,d,e;
	for(a=1;a<6;a++)
	{
		for(b=1;b<6;b++)
		{
			if(b==a)
				continue;
		for(c=1;c<6;c++)
			{
			if(c==a||c==b)
				continue;
				for(d=1;d<6;d++)
				{
					if(d==a||d==b||d==c)
						continue;
					e=15-a-b-c-d;
					if(e!=1&&e!=2&&e!=3&&e<6)
					{
					if(((e==1&&a==2)+(b==2)+(a==5&&(c==1||c==2))+(c!=1&&(d==1||d==2))+(d==1&&e==2)==2)&&((e!=1)+(a!=5)+(b!=2)+(c==1)+(d!=1)==3))
					{
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
					}
				}
			}
		}
	}
}
int main()
{
	int a,b,c,d,e,i,j,counter;
	int chang[6];
	int panduan[6];
	for(i=0;i<=5;i++) chang[i]=0;
	char cc;
	for(a=1;a<=5;a++)
	{
		for(b=1;b<=5;b++)
		{
			for(c=1;c<=5;c++)
			{
				for(d=1;d<=5;d++)
				{
					e=15-a-b-c-d;
					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))
					{
						chang[1]=a;chang[2]=b;chang[3]=c;chang[4]=d;chang[5]=e;
						for(i=0;i<=5;i++) panduan[i]=0;
					    if(e==1) panduan[a]++;
						if(b==2) panduan[b]++;
						if(a==5) panduan[c]++;
						if(c!=1) panduan[d]++;
						if(d==1) panduan[e]++;
						if((panduan[1]==1)&&(panduan[2]==1)&&(panduan[3]==0)&&(panduan[4]==0)&&(panduan[5]==0))
						{
							for(i=1;i<=4;i++)
							{
								cout<<chang[i]<<" ";
							}
							cout<<chang[5];
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int rank[100],a,b,c,d,e,name[60],i,p;                       /*    ??????*/
	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&&b!=c&&c!=d&&d!=e&&a!=c&&
							a!=d&&a!=e&&b!=d&&b!=e&&c!=e&&e!=2&&e!=3)
						{
			                for(i=1;i<=5;i++)                      /* ??????*/
						    {
		                       name[i]=0;
                            }
                        if(e==1)
					   name[a]=1;
                        if(b==2)
						name[b]=1;
					    if(a==5)
					    name[c]=1;
					    if(c!=1)
						name[d]=1;
						if(d==1)
						name[e]=1;
						
						if(name[1]==1&&name[2]==1&&name[3]==0&&name[4]==0&&name[5]==0)
						{   rank[1]=a;
						    rank[2]=b;
							rank[3]=c;
							rank[4]=d;
							rank[5]=e;
						}
						}
					}
				}
			}
		}
	}
	for(i=1;i<=4;i++)                            /*  ??????*/
		cout<<rank[i]<<" ";
	cout<<rank[5];
	return 0;
}
//============================================================================
// Name        : shihuijie.cpp
// Author      : ???
// Time        : 2013.11.08
// Description : ????
//============================================================================


int main() {
	int a,b,c,d,e;
	for(a=1;a<=5;a++){//a??
		for(b=1;b<=5;b++){//b??
			for(c=1;c<=5;c++){//c??
				for(d=1;d<=5;d++){//d??
					for(e=1;e<=5;e++){//e??
						if(e==2||e==3||a==b||a==c||a==d||a==e||b==c||b==d||b==e||c==d||c==e||d==e)
							continue;
						//???????
					    if(((c==1)+(a==5)+(b==2)+(b==2)==4)&&((e==1)+(c!=1)+(d==1)==0)){
					    	cout<<a<<" "<<b<<" "<<c<<" "<<d<<' '<<e<<endl;
					    	break;
						}
					    else if(((d==1)+(c!=1)+(b==2)+(b==2)==4)&&((e==1)+(a==5)+(d==1)==0)){
					    	cout<<a<<" "<<b<<" "<<c<<" "<<d<<' '<<e<<endl;
					    	break;
					    }
					    else if(((d==1)+(c!=1)+(c==2)+(a==5)==4)&&((e==1)+(b==2)+(d==1)==0)){
					    	cout<<a<<" "<<b<<" "<<c<<" "<<d<<' '<<e<<endl;
					    	break;
					    }
					    else if(((d==1)+(c!=1)+(e==2)+(d==1)==4)&&((e==1)+(b==2)+(a==5)==0)){
					    	cout<<a<<" "<<b<<" "<<c<<" "<<d<<' '<<e<<endl;
					    	break;
					    }

					}

				}

			}

		}

	}
	return 0;
}
int main()
{
	int a,b,c,d,e;
	c=1;
	a=5;
	e=4;
	for(b=2;b<4;b++)
	{
		d=5-b;
		if(b==2&&(b==2)==1&&(c!=1)==0)
			cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
		else if(d==2&&(b==2)!=1&&(c!=1)==1)
			cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
	}
    return 0;
}
int main()
{
	int A,B,C,D,E,a,b,c,d,e;
	int m[6];
	for(A=1;A<=5;A++){
	for(B=1;B<=5;B++){
	if(A==B) continue;
	for(C=1;C<=5;C++){
	if(B==C||A==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;
    a=(E==1);b=(B==2);c=(A==5);d=(C!=1);e=(D==1);
	if(E==2||E==3) break;
	m[A]=a;m[B]=b;m[C]=c;m[D]=d;m[E]=e;
	if((m[1]+m[2]==2)&&(m[3]+m[4]+m[5]==0))
		cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E;
}
}
}
}
}
	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) continue;
						if (e == 2 || e == 3) continue;

						A = (e == 1);
						B = (b == 2);
						C = (a == 5);
						D = (c != 1);
						E = (d == 1);
				
						if (a * A == 1 || b * B == 1 ||  c * C  == 1 || d * D == 1||  e * E == 1)
							if (a * A == 2 || b * B == 2 ||  c * C  == 2 || d * D == 2||  e * E == 2)
								if ((A * a + B * b + C * c + D * d + E * e) == 3)
									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(b==a)
			{
				continue;
			}
			else
			{
				for(c=1;c<=5;c++)
				{
					if((c==a)||(c==b))
					{
						continue;
					}
					else
					{
						for(d=1;d<=5;d++)
						{
							if((d==a)||(d==b)||(d==c))
							{
								continue;
							}
							else
							{
								for(e=1;e<=5;e++)
								{
									if((e==a)||(e==b)||(e==c)||(e==d))
									{
										continue;
									}
									if(e==2||e==3||d!=3)
									{
										continue;
									}
									if(((a==1||a==2)&&e==1)||(a!=1&&a!=2&&e!=1))
									{
										if(((b==1||b==2)&&(b==2))||(b!=1&&b!=2&&b!=2))
										{
											if(((c==1||c==2)&&a==5)||(c!=1&&c!=2&&a!=5))
											{
												if(((d==1||d==2)&&c!=1)||(d!=1&&d!=2&&c==1))
												{
													if(((e==1||e==2)&&d==1)||(e!=1&&e!=2&&e!=1))
													{
														cout<<a<<' ';
								                     	cout<<b<<' '; 
									                    cout<<c<<' '; 
								                     	cout<<d<<' ';
								                    	cout<<e<<endl;
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
//****????         *****
//****?? 1300012732  *****



int main()
{
	int a,b,c,d,e,sa,sb,sc,sd,se,ta,tb,tc,td,te;
	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++)
					{
						sa=(e==1);
						sb=(b==2);
						sc=(a==5);
						sd=(c!=1);
						se=(d==1);
						ta=sa*(a-1)*(a-2);
						tb=sb*(b-1)*(b-2);
						tc=sc*(c-1)*(c-2);
						td=sd*(d-1)*(d-2);
						te=se*(e-1)*(e-2);
						if((a-b)*(a-c)*(a-d)*(a-e)*(b-c)*(b-d)*(b-e)*(c-d)*(c-e)*(d-e)!=0 && ta==0 && tb==0 && tc==0 && td==0 && te==0 && sa+sb+sc+sd+se==2 && e!=2 && e!=3)
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
					}
					return 0;
}
/*
 * 5.cpp
 *
 *  Created on: 2011-11-6
 *      Author: zhujile
 */
int main(){
	int a,b,c,d,e,sum=0;        //a?b?c?d?e??????sum?????????????
	for (e=1;e<6;e++)           //??e
	{
		if ((e==2)||(e==3)) continue; //e???2?3?
		for (a=1;a<6;a++)             //??a
		{
			if (a==e) continue;       //?????????
			for (b=1;b<6;b++)
			{
				if ((b==a)||(b==e)) continue;  //?????????
				for (c=1;c<6;c++)
				{
					if ((c==a)||(c==b)||(c==e)) continue;  //?????????
					for (d=1;d<6;d++)
					{
						sum=0;                                         //sum??,????
						if ((d==a)||(d==b)||(d==c)||(d==e)) continue;  //?????????
						if ((a==1&&e==1)||(a==2&&e==1)) sum++;         //????????????????????
						else if ((a==3&&e==1)||(a==4&&e==1)||(a==5&&e==1)) continue;  //????????????????????
						if ((b==1&&b==2)||(b==2&&b==2)) sum++;
						else if ((b==3&&b==2)||(b==4&&b==2)||(b==5&&b==2)) continue;
						if ((c==1&&a==5)||(c==2&&a==5)) sum++;
						else if ((c==3&&a==5)||(c==4&&a==5)||(c==5&&a==5)) continue;
						if ((d==1&&c!=1)||(d==2&&c!=1)) sum++;
						else if ((d==3&&c!=1)||(d==4&&c!=1)||(d==5&&c!=1)) continue;
						if ((e==1&&d==1)||(e==2&&d==1)) sum++;
						else if ((e==3&&d==1)||(e==4&&d==1)||(e==5&&d==1)) continue;
						if (sum==2)                                    //???????????????,????
						{
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl; //???????
							a=b=c=d=e=6;                               //????
						}
					}
				}
			}
		}
	}
	return 0;
}
/*
 * ???:05.cpp
 * ???:???
 * ????:2011-11-06
 * ??:??A?B?C?D?E???????????????
 */

int main( )
{
    int a,b,c,d,e;     //????
    for(a=1;a<6;a++)     //??a?5???
    {
    	for(b=1;b<6;b++)     //??b?5???
    	{
    		if(b==a)     //????????????
    			continue;
    		for(c=1;c<6;c++)     //??c?5???
    		{
    			if(c==b||c==a)     //????????????
    				continue;
    			for(d=1;d<6;d++)     //??d?5???
    			{
    				if(d==a||d==b||d==c)     //????????????
    					continue;
    				for(e=1;e<6;e++)     //??e?5???
    				{
    					if(e==a||e==b||e==c||e==d||e==2||e==3)     //????????????
    						continue;
    					if((a==1||a==2)&&(e!=1))     //????????
    					    continue;
    					if(b==1)    //????????
    						continue;
    					if((c==1||c==2)&&(a!=5))    //????????
    						continue;
    					if((d==1||d==2)&&(c==1))    //????????
    						continue;
    					if((e==1||e==2)&&(d!=1))    //????????
    						continue;
                        if((e==1)+(b==2)+(a==5)+(c!=1)+(d==1)==2)    //?????
    						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
    				}
    			}
    		}
    	}
    }
	return 0;
}
int main()
{
    int a,b,c,d,e,as,bs,cs,ds,es;
    for(a=1;a<6;a++)
      for(b=1;b<6;b++) {
        if(b==a) continue;
        for(c=1;c<6;c++){
         if(c==b || c==a) continue;
           for(d=1;d<6;d++){
            if(d==c||d==b||d==a) continue;
              for(e=1;e<6;e++){
                if(e==d || e==c || e==b || e==a) continue;
                as= (e==1);
                bs= (b==2);
                cs= (a==5);
                ds= (c!=1);
                es= (d==1);
                if(((a==1 ||a==2)&&as) ||((a!=1&&a!=2)&&(as==0)))
                  if(((b==1 ||b==2)&&bs) ||((b!=1&&b!=2)&&(bs==0)))
                    if(((c==1 ||c==2)&&cs) ||((c!=1&&c!=2)&&(cs==0)))
                      if(((d==1 ||d==2)&&ds) ||((d!=1&&d!=2)&&(ds==0)))
                        if(((e==1 ||e==2)&&es) ||((e!=1&&e!=2)&&(es==0)))
                        if(e!=2&&e!=3)
                        {
                                       printf("%d %d %d %d %d",a,b,c,d,e);
                                       }
                                       }
                                       }
                                       }
                                       }
    
    
        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++)
    {
        if(((E!=2)+(E!=3)==2)&&((A!=B)+(A!=C)+(A!=D)+(A!=E)+(B!=C)+(B!=D)+(B!=E)+(C!=D)+(C!=E)+(D!=E)==10)&&((E==1)+(B==2)+(A==5)+(C!=1)+(D==1)==2)&&((A==5)+(B==2)+(C==1)+(D==3)==4))
        cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E;
    }
              return 0;
        }
int main()
{
	int a,b,c,d,e,guss[6],x,y,i,j;
	for(i=0;i<6;i++)
		guss[i]=0;
	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||e==2||e==3) continue;
						guss[a]=(e==1);
						guss[b]=(b==2);
						guss[c]=(a==5);
						guss[d]=!(c==1);
						guss[e]=(d==1);
						x=guss[1]+guss[2];
						for(j=3,y=0;j<=5;j++)
							y=y+guss[j];
						if(x==2&&y==0)
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
				}
			}
		}
	return 0;
}
/*??????????5???????????????????????5??
 * ????????E????????2???3??
A???????E???????
B?????????????????
C???????A????????
D???????C?????????
E???????D??????????
????????????????????????????????????A?B?C?D?E??????*/
int main()
{     int a=0, b=0,c=0,d=0,e=0;
      int num=0;
	for(int A=1;A<6;A++)
	   for(int B=1;B<6;B++)
	      for(int C=1;C<6;C++)
		    for(int D=1;D<6;D++)
				for(int E=1;E<6;E++)
						{   if(E==2 || E==3) continue;
							if(A==E || B==E || C==E || D==E || D==A || D==B || D==C || C==B || C==A || A==B)  continue;
							a=(E==1);
							b=(B==2);
							c=(A==5);
							d=(C!=1);
							e=(D==1);
							num= ( (A<3 && a==1) ||(A>=3 && a==0)) +
									( (B<3 && b==1) ||(B>=3 && b==0)) +
						        ( (C<3 && c==1) || (C>=3 && c==0) )+
						        ((D<3 && d==1 ) || (D>=3 && d==0 ))+
						        ((E<3 && e==1 ) || (E>=3 && e==0 ));
						//	cout<<num<<endl;
						if(num==5) cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
				       }
	
     return 0;
}
int main()
{
	int a, b, c, d, e, A, B, C, D, E;
	for (a = 1; a <= 5; a++)
	{
		if (a == 1 || a == 2)
			A = 1;
		else
			A = 0;
		for (b = 1; b <= 5; b++)
		{
			if (b == 1 || b == 2)
				B = 1;
			else
				B = 0;
			for (c = 1; c <= 5; c++)
			{
				if (c == 1 || c == 2)
					C = 1;
				else
					C = 0;
				for (d = 1; d <= 5; d++)
				{
					if (d == 1 || d == 2)
						D = 1;
					else
						D = 0;
					for (e = 1; e <= 5; e++)
					{
						if (e == 1 || e == 2)
							E = 1;
						else
							E = 0;
						if (e != 2 && e != 3)
						{
							if (a+b+c+d+e==15 && a*b*c*d*e==120 && A == (e == 1) && B == (b == 2) && C == (a == 5) && D == (c != 1) && E == (d == 1))
							{
								if (A+B+C+D+E == 2)
								{
									cout << a << " " << b << " " << c << " " << d << " " << e << endl;
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	for (int a=2;a<=5;a++)
	{
		for (int b=2;b<=5;b++)
		{
			for (int c=1;c<=5;c++)
			{
				for (int d=2;d<=5;d++)
				{
					for (int e=4;e<=5;e++)
					{
						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;
}
/*
 * 01.cpp
 *
 *  Created on: 2011-11-6
 *      Author: ???
 */

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(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)
				{
					E=15-A-B-C-D;               //A?B,C,D,E????
					cc1=(E==1);
					cc2=(B==2);
					cc3=(A==5);
					cc4=(C!=1);
					cc5=(D==1);                //A?B?C?D?E????

					if(((A+cc1)*(B+cc2)*(C+cc3)*(D+cc4)*(E+cc5)==360)
							&&((A-cc1)*(B-cc2)*(C-cc3)*(D-cc4)*(E-cc5)==0)
							&&(cc1+cc2+cc3+cc4+cc5==2)&&((A-cc1)+(B-cc2)+(C-cc3)+(D-cc4)+(E-cc5)==13)&&(E!=2)&&(E!=3))
							//?????????????
					{
						cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
					}




				}
			}
		}
	return 0;
}
int main()
{
	int a[6], b[6], k;
	for (a[5] = 1; a[5] <= 5; a[5]++)
	{
		if (a[5] != 2 && a[5] != 3)
		{
			for (a[1] = 1; a[1] <= 5;a[1]++)
			{
				if (a[1] != a[5])
				{
					for (a[2] = 1; a[2] <= 5; a[2]++)
					{
						if (a[2] !=a[1] && a[2] != a[5])
						{
							for (a[3] = 1; a[3] <= 5; a[3]++)
							{
								if (a[3] != a[1] && a[3] != a[2] && a[3] != a[5])
								{
									k = 0;
									a[4] = 15 - a[1] - a[2] - a[3] - a[5];
									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);
									if (b[1] + b[2] + b[3] + b[4] + b[5] == 2)
									{
										for (int j = 1; j <= 5; j++)
										{
											if (((a[j]==1) + (a[j] == 2) == 0) && (b[j] == 1))
												break;
											else
											{
												if (((a[j]==1) + (a[j] == 2) == 1) && (b[j] == 1))
													k++;
											}
										}
										if (k == 2)
										{
											for (int j = 1; j <= 4; j++)
											{
												cout << a[j] << " ";
											}
											cout << a[5];
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}


	return 0;
}
int f(int a[])
{
	int f=0,f2=0,i;
	if(a[1]==1||a[1]==2)
	{
		if(a[5]==1) f++;
	}
	else
		if(a[5]!=1) f2++;

	if(a[2]==1||a[2]==2)
	{
		if(a[2]==2) f++;
	}
	else
		if(a[2]!=2) f2++;

	if(a[3]==1||a[3]==2)
	{
		if(a[1]==5) f++;
	}
	else
		if(a[1]!=5) f2++;
	if(a[4]==1||a[4]==2)
	{
		if(a[3]!=1) f++;
	}
	else
		if(a[3]==1) f2++;
	if(a[5]==1||a[5]==2)
	{
		if(a[4]==1) f++;
	}
	else
		if(a[4]!=1) f2++;

	if(f==2&&f2==3)
	{
		for(i=1;i<5;i++)
			printf("%d ",a[i]);
        printf("%d",a[5]);
		return f;
	}
    else
		return 0;
}

int main()
{
	int a[6]={0,1,2,3,4,5},b;
	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[1]*a[2]*a[3]*a[4]*a[5]==120&&a[5]!=2&&a[5]!=3)
						{
							b=f(a)/2;
							if(b==1) break;
						}
					}if(b==1) break;
				}if(b==1) break;
			}if(b==1) break;
		}if(b==1) break;
	}
	return 0;

}
int main()
{
	int a[6];
	for(a[1]=1;a[1]<=5;a[1]++)
	{
		for(a[2]=1;a[2]<=5;a[2]++)
		{
			if(a[2]!=a[1])
			{
				for(a[3]=1;a[3]<=5;a[3]++)
				{
					if((a[3]!=a[1])&&(a[3]!=a[2]))
					{
						for(a[4]=1;a[4]<=5;a[4]++)
						{
							if((a[4]!=a[1])&&(a[4]!=a[2])&&(a[4]!=a[3]))
								for(a[5]=1;a[5]<=5;a[5]++)
								{
									if((a[5]!=a[1])&&(a[5]!=a[2])&&(a[5]!=a[3])&&(a[5]!=a[4])&&(a[5]!=2&&a[5]!=3))
									{
										int num=0;
										if(a[1]<=2&&a[5]==1) num++;
										if(a[2]<=2&&a[2]==2) num++;
										if(a[3]<=2&&a[1]==5) num++;
										if(a[4]<=2&&a[3]!=1) num++;
										if(a[5]<=2&&a[4]==1) num++;
										if(num==2&&((a[5]==1)+(a[2]==2)+(a[1]==5)+(a[3]!=1)+(a[4]==1))==2)
										{
											cout<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<" "<<a[5];
										}
										
									}
								}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a[5],i,j,k,l,m,n,q=0;
	for(i=1;i<=5;i++)
	{
		a[0]=i;
		for(j=1;j<=5;j++)
		{
			a[1]=j;
			for(k=1;k<=5;k++)
			{
				a[2]=k;
				for(l=1;l<=5;l++)
				{
					a[3]=l;
					for(m=1;m<=5;m++)
					{
						a[4]=m;
						if(i!=j&&i!=k&&i!=l&&i!=m&&j!=k&&j!=l&&j!=m&&k!=l&&k!=m&&l!=m&&((a[4]==1)+(a[1]==2)+(a[0]==5)+(a[2]!=1)+(a[3]==1))==2)
						{
							q++;
							if(q==41)
							{
							for(n=0;n<4;n++)
							cout<<a[n]<<" ";
							cout<<a[4];
							break;
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a[6],c[6],b[6],i;
	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[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] &&
				a[5]!=2    && a[5]!=3)
			{
				for(i=1;i<6;i++)
					c[a[i]]=i;
					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);
				if(b[c[1]]+b[c[2]]==2 && b[c[3]]+b[c[4]]+b[c[5]]==0)
				{
					cout<<a[1];
					for(i=2;i<6;i++)
						cout<<' '<<a[i];
					
					cout<<endl;
				}

			}

	return 0;

}
int main()
{
	int A, B, C, D, E, 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==B||C==A ) 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;
						a = (E == 1);
						b = (B == 2);
						c = (A == 5);
						d = (C > 1);
						e = (D == 1);
						if ( a+b+c+d+e == 2)
							if ( (A <= 2 && B <= 2 && a+b == 2)
							|| (A <= 2 && C <= 2 && a+c == 2)
							|| (A <= 2 && D <= 2 && a+d == 2)
							|| ( A <= 2 && E <= 2 && a+e == 2)
							|| ( B <= 2 && C <= 2 && b+c == 2)
							|| ( B <= 2 && D <= 2 && b+d == 2)
							|| ( B <= 2 && E <= 2 && b+e == 2)
							|| ( C <= 2 && D <= 2 && c+d == 2)
							|| ( C <= 2 && E <= 2 && c+e == 2)
					        || ( D <= 2 && E <= 2 && d + e == 2))
							cout << A << " " << B << " " << C << " " << D << " " << E << endl;
					}
				}
			}
		}
	return 0;
}
int main()
{
 int a[6] = {0},c[6]={0},flag=0;
 for (a[1]=1;a[1]<=5;a[1]++)
 {for (a[2]=1;a[2]<=5;a[2]++)
 {if (a[1]==a[2]) continue;
  for (a[3]=1;a[3]<=5;a[3]++)
 {if (a[1]==a[3]||a[2]==a[3]) continue;
 for (a[4]=1;a[4]<=5;a[4]++)
 {
 if (a[4]==a[1]||a[4]==a[2]||a[4]==a[3]) continue;
 for (a[5]=1;a[5]<=5;a[5]++)
 {flag = 0; 
 if (a[5]==a[1]||a[5]==a[2]||a[5]==a[4]||a[5]==a[3]) continue;
 c[1]=(a[5]==1);
 c[2]=(a[2]==2);
 c[3]=(a[1]==5);
 c[4]=(a[3]!=1);
 c[5]=(a[4]==1);
 
 if ((a[5]!=2&&a[5]!=3)&&((c[1]+c[2]+c[3]+c[4]+c[5])==2))
    {
         for (int i=1;i<=5;i++)
         {if ((a[i]==1&&c[i]==1)||(a[i]==2&&c[i]==1))
            flag++;
         }
         if (flag==2)
         {
          for (int i=1;i<=4;i++)
          cout<<a[i]<<" ";
           cout<<a[5];
         }
    }


}
}
}
}
}
 
 
 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++)
				{   while (a==1&&a==2)
				    {if (e!=1)
				     continue;}
				    while (b==1&&b==2)
				    {if (b!=2)
				     continue;}
				    while (c==1&&c==2)
				    {if (a!=5)
				     continue;}
				    while (d==1&&d==2)
				    {if (c=1)
				     continue;}
				    while (e==1&&e==2)
				    {if (d!=1)
				     continue;}
					if(((e==1)+(b==2)+(a==5)+(c!=1)+(d==1)==2)&&e!=2&&e!=3&&a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e&&e!=1&&d!=1&&a!=1&&b!=1)
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
				}    
return 0;
}
int main()
{
	int panduan(int a,int b,int c,int d,int e);
	int i,j,p,q,m,a,b,c,d,e;
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			for(p=1;p<=5;p++)
				for(q=1;q<=5;q++)
					for(m=1;m<=5;m++)
					{
						a=i;b=j;c=p;d=q;e=m;
						if(panduan(a,b,c,d,e)==1&&a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=e&&b!=d&&c!=d&&c!=e&&d!=e)
							printf("%d %d %d %d %d\n",a,b,c,d,e);
					}
	return 0;
}
int panduan(int a,int b,int c,int d,int e)
{
	if(a==1||b==1||e==1||a==2||e==2||e==3||e==1)
	{
		return 0;
	}
	else if(c==1)
	{
		if(a!=5)
			return 0;
		else if(b==2)
		{
			if(e==1||d==1)
				return 0;
			else
				return 1;
		}
		else if(d==2)
		{
			return 0;
		}
	}
	else if(d==1)
	{
		if(c!=5)
			return 0;
		else if(b==2)
		{
			return 0;
		}
		else if(c==2)
		{
			if(a==5)
				return 1;
			else
				return 0;
		}
	}
}