semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main ()
{
     int a,b,c,d,e,sum,t[6],s[6],po;
     int l , j , m ,i;
     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 ++ )
                     {
                         po = 0 ;
                          t[1] = a ; t[2] = b ; t[3] = c ; t[4] = d ; t[5] = e;
                         l = a + b + c + d + e ;
                         m = a*b*c*d*e ;
                         
                             if (m==120&&l==15&& e != 2 && e != 3)
                             {
                                                 s[1] = (e==1);
                                                      s[2]= (b==2);
                                                      s[3] = (a==5) ;
                                                      s[4] =(c!=1) ;
                                                      s[5] = (d==1) ;
                                 
                                  for ( i = 1 ; i <= 5 ; i++)
                                  {
                                      if(( t[i] == 1 || t[i] == 2)&&s[i] == 1 )
                                      {
                                          
                                               po++;
                                          
                                      }
                                      else
                                      continue ;
                                  }
                                  if (po == 2&& c == 1)
                                   {
                                         cout << a << " " << b <<" "<<c<<" "<< d <<" "<<e<<endl;
                                   }  
                             }  
                     }      
                 } 
             }   
         } 
     }
     return 0 ;
}
int main()
{
    int A, B, C, D ,E, count=0;
    
    cout<<"5"<<" "<<"2"<<" "<<"1"<<" "<<"3"<<" "<<"4"<<endl;
    
    
    return 0;
    }
/*
 *???:find.cpp
 *??:??
 *????: 2012-12-01
 *??:??????????
 */


int main(){
   int A,B,C,D,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++)
				   for(E=1;E<6;E++)
					   {if((A+B+C+D+E)!=15||(A*B*C*D*E!=120)||E==2||E==3)                                             //???????
							   continue;
					    if(((A==1||A==2)&&E==1)+((B==1||B==2)&&B==2)+((C==1||C==2)&&A==5)
					    		+((D==1||D==2)&&C!=1)+((E==1||E==2)&&D==1)==2&&(E==1)+(B==2)+(A==5)+(C!=1)+(D==1)==2) //??????
					    	cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
					   }
   return 0;
}
/*
 * ktpm.cpp
 *
 *  Created on: 2011-11-15
 *      Author: FXD
 */
int main()//?????
{
	int a,b,c,d,e;//a~e????A~E???
	int x[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==b||b==c||a==c) continue;
				for(d=1;d<=5;d++)
				{
					if(a==b||a==c||a==d||b==c||b==d||c==d) continue;
					for(e=1;e<=5;e++)
					{
						if(a==b||a==c||a==d||b==c||b==d||c==d||a==e||b==e||c==e||d==e||e==2||e==3) continue;//for????????????e?2?3???????
						x[a]=(e==1);
						x[b]=(b==2);
						x[c]=(a==5);
						x[d]=(c!=1);
						x[e]=(d==1);//
						if((x[1]+x[2]==2)&&(x[3]+x[4]+x[5]==0))//?????????????????
						{
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;//??a~e???
						}
					}
				}
			}
		}
	}
	return 0;//???????????????????
}
int main()
{
	int a[6];
	int b[6] , c[6];
	int i , j , flag = 0;
	for (b[1] = 1 ; b[1] <= 5 ; b[1]++)
	{
		for (b[2] = 1 ; b[2] <= 5 ; b[2]++)
		{
			if (b[2] == b[1])
			{
				continue;
			}
			for (b[3] = 1 ; b[3] <= 5 ; b[3]++)
			{
				if ((b[3] == b[2])||(b[3] == b[1]))
				{
					continue;
				}
				for (b[4] = 1 ; b[4] <= 5 ; b[4]++)
				{
					if ((b[4] == b[1])||(b[4] == b[2])||(b[4] == b[3]))
					{
						continue;
					}
					b[5] = 15 - b[1] - b[2] - b[3] - b[4];
					if ((b[5] == 2)||(b[5] == 3))
					{
						continue;
					}
					for (i = 1 ; i <= 5 ; i++)
					{
						for (j = 1 ; j <= 5 ; j++)
						{
							if (b[i] == j)
							{
								a[j] = i;
							}
						}
					}
					c[1] = (b[5] == 1);
					c[2] = (b[2] == 2);
					c[3] = (b[1] == 5);
					c[4] = (b[3] != 1);
					c[5] = (b[4] == 1);
					if (((c[a[1]] + c[a[2]]) == 2)&&((c[a[3]] + c[a[4]] + c[a[5]]) == 0))
					{
						cout << b[1];
						for (i = 2 ; i <= 5 ; i++)
						{
							cout << ' ' << b[i];
						}
						cout << endl;
						flag = 1;
						break;
					}
				}
				if (flag)
				{
					break;
				}
			}
			if (flag)
			{
				break;
			}
		}
		if (flag)
		{
			break;
		}
	}
    return 0;
}
main ()
{
     int a,b,c,d,e;
              //???a?? 
     a=1;d=1; //a==d???
              //e!=1,e!=2,e!=3,a!=1,a!=2
     b=2;       //??b??
     c=1;a=5;e=4;d=3;//??c??
     //?????
     printf ("%d %d %d %d %d\n",a,b,c,d,e);
}
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==2 || E==3 ||E==A || E==B || E==C || E==D)
				                       continue;
			                          else
									  {
										  if ( (A==1 || A==2) + (E !=1)==1)
										  {
											  if ((B==1 || B==2) + (B!=2)==1)
											  {
												  if ((C==1||C==2) +(A!=5)==1)
												  {
													  if ((D==1||D==2)+ (C==1)==1)
													  {
														  if ((E==1||E==2)+ (D!=1)==1)
														  {
															  cout << A << " "<<B << " "<<C << " "<<D<< " "<<E <<endl;
														  }
													  }
												  }
											  }
										  }
									  }
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{   int word[6],a,b,c,d,e;
    word[0]=-1; 
	for(a=1;a<=5;a++)
 	  for(b=1;b<=5;b++)
	  { if(a==b||b==1||b==3||b==4||b==5)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;
			    word[a]=(e==1);
				word[b]=1;
				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)cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;;
			   }
			 }
		   }
		}
	return 0;
}
int main()
{
  int a,b,c,d,e;
  for(a=1;a<6;a++)
  { for(b=2;b<=2;b++)
  { for(c=1;c<6;c++)
  { for(d=1;d<6;d++)
  { for(e=1;e<6;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))
   { if(((a==5)&&(c==1))==1)
		 cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
	 }
  }
  }
  }
  }
}
  return 0;
}
int main()
{
    int taxis[5],cc[5],i;
    for(taxis[0]=0; taxis[0]<5; taxis[0]++)//?????
    {
        for(taxis[1]=0; taxis[1]<5; taxis[1]++)//?????
        {
            if(taxis[0]==taxis[1])//?????????
                continue;
            for(taxis[2]=0; taxis[2]<5; taxis[2]++)//?????
            {
                if(taxis[2]==taxis[0] || taxis[2]==taxis[1])//?????????
                    continue;
                for(taxis[3]=0; taxis[3]<5; taxis[3]++)//?????
                {
                    if(taxis[3]==taxis[0]||taxis[3]==taxis[1]||taxis[3]==taxis[2])//?????????
                        continue;
                    for(taxis[4]=0; taxis[4]<5; taxis[4]++)//?????
                    {
                        if(taxis[4]==taxis[0]||taxis[4]==taxis[1]||taxis[4]==taxis[2]||taxis[4]==taxis[3])//?????????
                            continue;
                        cc[0]=(4==taxis[0]);//A????
                        cc[1]=(1==taxis[1]);//B????
                        cc[2]=(0==taxis[4]);//C????
                        cc[3]=(2!=taxis[0]);//D????
                        cc[4]=(3==taxis[0]);//E????
                        if(cc[taxis[0]]==1 && cc[taxis[1]]==1 && cc[taxis[2]]==0 && cc[taxis[3]]==0 && cc[taxis[4]]==0 &&//?????1???2?????????
                           taxis[1]!=4 && taxis[2]!=4)//E??????2???3?
                        {
                            for(i=0; i<5; i++)
                            {
                                for(int j=0;j<5;j++)
                                    if(taxis[j]==i)
                                        cout<<j+1;//??????
                                if(i==4) cout<<endl;
                                else cout<<' ';
                            }
                        }
                    }
                }
            }
        }
    }
    return 0;//?????
}
int main()
{
	int i,j;
	int rank[6];
	for(rank[1]=1;rank[1]<=5;rank[1]++)
		for(rank[2]=1;rank[2]<=4;rank[2]++)
		{
			if(rank[2]==rank[1]) continue;
			for(rank[3]=1;rank[3]<=4;rank[3]++)
			{
				if(rank[3]==rank[2]||rank[3]==rank[1]) continue;
				for(rank[4]=1;rank[4]<=5;rank[4]++)
				{
					if(rank[4]==rank[1]||rank[4]==rank[2]||rank[4]==rank[3])  continue;
					for(rank[5]=1;rank[5]<=5;rank[5]++)
					{
						if(rank[5]==rank[1]||rank[5]==rank[2]||rank[5]==rank[3]||rank[5]==rank[4]) continue;
						int decide[5]={(rank[1]==5),(rank[2]==2),(rank[5]==1),(rank[1]!=3),(rank[1]==4)};
						int count=0;
						if(decide[0]+decide[1]+decide[2]+decide[3]+decide[4]==2)
						{
							for(j=0;j<=4;j++)
								if(decide[j]==1&&(rank[1]==j+1||rank[2]==j+1)) count++; 
							if(count==2)
							{
								for(i=1;i<=5;i++)
									for(j=1;j<=5;j++)
									{
										if(i==rank[j]) 
										{
											if(i==1)  cout<<j;
											else
											{cout<<" "<<j;break;}
										}

									}
									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;
	for (c = 1; c <= 5; c++) {
		if (c == b || c == a)
			continue;
	for (d = 1; d <= 5; d++) {
		if (d == c || d == c || d == b || d == a)
			continue;
	for (e = 1; e <= 5; e++) {
		if (e == d || e == c || e == c || e == b || e == a)
			continue;
		if (e == 2 || e == 3)
			continue;
		if (e == 1 && (a == 1 || a == 2) || a != 1 && a != 2 && e != 1)
			if (b == 2 || b != 1 && b != 2)
			if (a == 5 && (c == 1 || c == 2) || c != 1 && c != 2 && a !=5)
				if (c != 1 && (d == 1 || d == 2) || d != 1 && d != 2 && c == 1)
					if (d == 1 && (e == 1 || e == 2) || e != 1 && e != 2 && d != 1)
						printf("%d %d %d %d %d", a, b, c, d, e);
	}
	}
	}
	}
	}
}
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==b)+(c==a)!=0)continue;
				for(d=1;d<6;d++){
					if((d==c)+(d==b)+(d==a)!=0)continue;
					for(e=1;e<6;e++){
						if((e==d)+(e==c)+(e==b)+(e==a)+(e==2)+(e==3)!=0)continue;
						if((e==1)+(b==2)+(a==5)+(c!=1)+(d==1)==2){//??????,???"????????????????????"??
							int w[5];
							w[a-1]=(e==1);
							w[b-1]=(b==2);
							w[c-1]=(a==5);
							w[d-1]=(c!=1);
							w[e-1]=(d==1);
							if((w[0]==1)+(w[1]==1)==2)cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
							else continue;//???????????,?????-1,????????????,??????????1
							}
						}
					}
				}
			}
		}
	return 0;
}
/*
 * air.cpp
 *
 *  Created on: 2011-11-9
 *      Author: wuch
 */

int main(){
	int a,b,c,d,e,aa,bb,cc,dd,ee;   //????a,b,c,d,e??????aa,bb,cc,dd,ee
	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{
			e=15-a-b-c-d; //????15
			if ((e==2)||(e==3)) continue;
			else{
				aa=(e==1);
				bb=(b==2);
				cc=(a==5);
				dd=(c!=1);
				ee=(d==1);
				if ((a*aa+b*bb+c*cc+d*dd+e*ee==3)&&(aa+bb+cc+dd+ee==2)) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
				//??????????1,2????????
			}
		}
	return 0;
}
int main()
{
	int a , b , c , d , e ;
	int A , B , C , D , E ;
	for ( a = 3 ; 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 == 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 )
						{
							if ( ( b == 1 || b == 2 ) && B == 1 )
						{	
							if ( c != b && c <= 2 && C == 1 )
								cout << a << " " << b << " " << c << " " << d << " " << e << endl ;
							if ( d != b && d <= 2 && D == 1 )
								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++)
     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)//???????
           {
               if(e!=2&&e!=3)
               {
                   if((((a==1||a==2)+(e==1))!=1)&&(((b==1||b==2) +(b==2))!=1)&&(((c==1||c==2)+ (a==5))!=1)&&(((d==1||d==2)+(c!=1))!=1)&&(((e==1)+(d==1))!=1))//???????????????????????
                   {


                   if((((a==1||a==2)+(e==1))==2)+(((b==1||b==2) +(b==2))==2)+(((c==1||c==2)+ (a==5))==2)+(((d==1||d==2)+(c!=1))==2)+(((e==1)+(d==1))==2)==2)//??2???
                   {
                       cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;//??
                   }
                   }

               }

       }}

}
int judge(int a,int b,int c,int d,int e)
{
   if (a!=b&a!=c&&a!=d&&a!=e)
     if (b!=c&&b!=d&&b!=e)
       if (c!=d&&c!=e)
         if (d!=e)
          return 1;
   return 0;
}
int main()
{
   int a,b,c,d,e,cor=0,i,time=0;
   int re[5]={0},p[5];
   for (a=1;a<=5;a++)
     for (b=2;b<=2;b++)
       for (c=1;c<=5;c++)
         for (d=1;d<=5;d++)
           for (e=1;e<=5;e++)
           {
               if (judge(a,b,c,d,e))
               {
                re[0]=0;re[1]=0;re[2]=0;re[3]=0;re[4]=0;
                cor=0;
                 if (e==1)  re[0]++;
                 if (b==2)  re[1]++;

                 if (a==5) re[2]++;

                if (c!=1)  re[3]++;

                if (d==1)   re[4]++;
                //if (cor==2)
                //if (a-re[0]<=2&&b-re[1]<=2&&c-re[2]<=2&&d-re[3]<=2&&e-re[4]<=2)
                p[0]=a;p[1]=b;p[2]=c;p[3]=d;p[4]=e;
                for (i=0;i<5;i++)
                  if ((re[i]==1&&p[i]==1)||(re[i]==1&&p[i]==2))
                    cor++;
                  else
                     if (re[i]==1&&p[i]!=1&&p[i]!=2) cor--;
                //printf("%d\n",cor);
                if (cor==2&&time==0) {printf("%d %d %d %d %d\n",a,b,c,d,e);time++;}
               }
           }
}
int f1(int d[])
{
	if(d[0]==1||d[0]==2)
	{
		if(d[4]==1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[4]==1)
			return 1;
		else
			return 0;
	}
}
int f2(int d[])
{
	if(d[1]==1||d[1]==2)
	{
		if(d[1]==2)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[1]==2)
			return 1;
		else
			return 0;
	}
}
int f3(int d[])
{
	if(d[2]==1||d[2]==2)
	{
		if(d[0]==5)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[0]==5)
			return 1;
		else
			return 0;
	}
}
int f4(int d[])
{
	if(d[3]==1||d[3]==2)
	{
		if(d[2]!=1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[2]!=1)
			return 1;
		else
			return 0;
	}
}
int f5(int d[])
{
	if(d[4]==2||d[4]==3)
		return 1;
	else if(d[4]==1)
	{
		if(d[3]==1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[3]==1)
			return 1;
		else
			return 0;
	}
}





void main()
{
	int i,j,k,l,m,mark=1,c[5]={1,2,3,4,5},d[5];
	for(i=0;i<5;i++)
	{
		d[0]=c[i];
		for(j=0;j<5;j++)
		{
			if(j==i)
				continue;
			d[1]=c[j];
			for(k=0;k<5;k++)
			{
				if(k==i||k==j)
					continue;
				d[2]=c[k];
				for(l=0;l<5;l++)
				{
					if(l==i||l==j||l==k)
						continue;
					d[3]=c[l];
					for(m=0;m<5;m++)
					{
						if(m==i||m==j||m==k||m==l)
							continue;
						d[4]=c[m];
						if(mark)
						{
							if(mark=f1(d))
								continue;
							if(mark=f2(d))
								continue;
							if(mark=f3(d))
								continue;
							if(mark=f4(d))
								continue;
							if(mark=f5(d))
								continue;
						}
						if(mark==0)
								break;
					}
					if(mark==0)
						break;
				}
				if(mark==0)
					break;
			}
			if(mark==0)
				break;
		}
		if(mark==0)
			break;
	}
	printf("%d %d %d %d %d\n",d[0],d[1],d[2],d[3],d[4]);
}
int main()
{
	int p[5] = {0};
	int a, b, c, d, e, i , j, g;
	
	for (p[0] = 1; p[0] <= 5; p[0]++)
		for (p[1] = 1; p[1] <= 5; p[1]++)
			for (p[2] = 1; p[2] <= 5; p[2]++)
				for (p[3] = 1; p[3] <= 5; p[3]++)
					for(p[4] = 1; p[4] <= 5; p[4]++)
					{
						g = 0;
					    if (p[4] == 2 || p[4] == 3)
							continue;
						for(i = 0; i < 5; i++)
							for(j = i + 1; j < 5; j++)
								if(p[i] == p[j])
									g = 1;
						if(g == 1)
							continue;

						a = (p[4] == 1) - (p[0] == 1 || p[0]== 2);
						b = (p[1] == 2) - (p[1] == 1 || p[1]== 2);
						c = (p[0] == 5) - (p[2] == 1 || p[2]== 2);
						d = (p[2] != 1) - (p[3] == 1 || p[3] == 2);
						e = (p[3] == 1) - (p[4] == 1 || p[4] == 2);
						if (a==0 && b == 0 && c== 0 && d==0 && e==0)
							for(i = 0 ; i < 5; i++)
							{
							   cout << p[i];
							   if (i < 4)
								   cout << " ";
							}
					}
		
    return 0;
}
int main()
{
	int first, second;
	int a[6], b[6],c[6] = {0,0,0,0,0,0};//c?????1,2??
	int m,c1;
	for (a[1] = 1; a[1] <= 5; a[1]++)
		for (a[2] = 1; a[2]<= 5; a[2]++)
			for (a[3] = 1; a[3] <= 5; a[3]++)
				for (a[4] = 1; a[4] <= 5; a[4]++)
				{
					a[5] = 15 - a[1] - a[2] - a[3] - a[4];
					if (a[1] * a[2] * a[3] * a[4]* a[5] == 120)
					{
						for (int i = 1, c1 = 1; i <= 5; i++)
							if (a[i] == 1)
								first = i;
							else if(a[i] == 2)
								second = i;
							else 
							{
								c[c1] = i;
								c1++;
							}
						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);
						m = b[c[1]] + b[c[2]] + b[c[3]] ;
						if (a[1] == 5 && a[2] == 2 && a[3] == 3)
							cin >> c[6];
						if (b[first] == 1 && b[second] == 1 && m == 0 && a[5] != 2 && a[5] != 3)
						{
							cout << a[1];
							for (int k = 2; k <= 5; k++)
								cout << " " <<a[k];
							return 0;
						}
					}
				}
}
int main()
{
	int a,b,c,d,e,x1,x2,x3,x4,x5;                                 //a,b,c,d,e????????????

	for(a=1;a<6;a++){
		for(b=1;b<6;b++){

			for(c=1;c<6;c++){
				if(b==a)
				break;

				for(d=1;d<6;d++){
					if(c==b)
					break;
				if(c==a)
					break;

				for(e=4;e<6;e++){
					if(d==c)
						break;
					if(d==b)
						break;
					if(d==a)
						break;
					if(e==a)
						break;
					if(e==b)
						break;
					if(e==c)
						break;
					if(e==d)
						break;                                        //????????????
					x1=((a<3)&&(e==1))||((a>2)&&(e!=1));
					x2=(b==2)||(b>2);
					x3=((c<3)&&(a==5))||((c>2)&&(a<5));
					x4=((d<3)&&(c!=1))||((d>2)&&(c==1));
					x5=(d!=1);                                              //???????

					if(x1+x2+x3+x4+x5==5){
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;

					}
				}
		}
		}
		}
		}

	return 0;
}
int main()
{
  int es[6],cc[6],i,A,B,C,D,E;
  for(es[1]=1;es[1]<=5;es[1]++)
	  for(es[2]=1;es[2]<=4;es[2]++)
	  {
	    if(es[1]==es[2])  continue;
		for(es[3]=1;es[3]<=4;es[3]++)
		{
		  if(es[3]==es[2]||es[3]==es[1])  continue;
		  for(es[4]=1;es[4]<=5;es[4]++)
		  {
			  if(es[4]==es[1]||es[4]==es[2]||es[4]==es[3])  continue;
		      for(es[5]=1;es[5]<=5;es[5]++)
			  {
			    if(es[5]==es[1]||es[5]==es[2]||es[5]==es[3]||es[5]==es[4])  continue;
				cc[1]=(es[1]==5);
				cc[2]=(es[2]==2);
				cc[3]=(es[5]==1);
				cc[4]=(es[1]!=3);
				cc[5]=(es[1]==4);
				if(cc[es[1]]&&cc[es[2]]&&cc[es[3]]==0&&cc[es[4]]==0&&cc[es[5]]==0)
				{
				  for(i=1;i<=5;i++)
				  {
				     switch(es[i])
					 {
					   case 1: A=i; break;
					   case 2: B=i; break;
					   case 3: C=i; break;
					   case 4: D=i; break;
					   case 5: E=i; break;
					 }
				  }
				  printf("%d %d %d %d %d\n",A,B,C,D,E);
				  return 0;
				}
			  }
		  }
		      
		}
	  }
}
int main()
{
    int A,B,C,D,E;
  for(int a=1;a<6;a++)
  {
   for(int b=1;b<6;b++)
   {
    if(a==b)
    continue;
    else
    {
     for(int c=1;c<6;c++)
     {
       if((c==a)||(c==b))
       continue;
       else
       {
        for(int d=1;d<6;d++)
        {
         if((d==a)||(d==b)||(d==c))
         continue;
         else
         {
           for(int e=1;e<6;e++)
           {
             if((e==a)||(e==b)||(e==c)||(e==d))
             continue;
             else
             {
                 A=(e==1);
                 B=(b==2);
                 C=(a==5);
                 D=(c!=1);
                 E=(d==1);
                 if((A+B+C+D+E==2)&&(e!=2)&&(e!=3))
                 {
                    if((A&&(a==1||a==2))+(B&&(b==1||b==2))+ (C&&(c==1||c==2))+ (D&&(d==1||d==2))+ (E&&(e==1||e==2))==2)
                    {
                                                            cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
                    } 
                 }                                     
             } 
             }
             }
             }
             }
             }
             }
             }
             }
             return 0;
             }
int main(){
	int f,s;
	int i,j,k;
	int a[6] = {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[3]==a[1]||a[3]==a[2])continue;
				for(a[4]=1;a[4]<=5;++a[4]){
					if(a[4]==a[1]||a[4]==a[2]||a[4]==a[3])continue;
					a[5]=15-a[1]-a[2]-a[3]-a[4];
					if(a[2]==5||a[3]==5)continue;
					if(a[1]==1||a[2]==1){
						if(a[1]!=5)continue;
					}
					if(a[1]==2||a[2]==2){
						if(a[2]!=2)continue;
					}
					if(a[1]==3||a[2]==3){
						if(a[5]!=1)continue;
					}
					if(a[1]==4||a[2]==4){
						if(a[1]==3)continue;
					}
					if(a[1]==5||a[2]==5){
						if(a[1]!=4)continue;
					}
					int cnt = 0;
					cnt = (a[1]==5) + (a[2]==2) + (a[5]==1) + (a[1]!=3) + (a[1]==4);
					if(cnt!=2)continue;
					int b[6];
					for(int i=1;i<=5;++i){
						b[a[i]]=i;
					}
					for(int i=1;i<5;++i){
						cout<<b[i]<<" ";
					}
					cout<<b[5];
				}
			}	
		}
		cin>>f;
	return 0;
}
int bb(int x,int y)
{
     if((x==1)||(x==2))
	 {if(y==1)
	 return 1;
	 else 
		 return 0;
	 }
	 else
	 {if(y==1)
	 return 0;
	 else 
		 return 1;
	 }

}

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(d=1;d<=5;d++)
			 { if(a==d||b==d||c==d)
				 continue;
			 e=15-a-b-c-d;
			 if(e!=2&&e!=3)
			 {as=(e==1);
			  bs=(b==2);
			   cs=(a==5);
			   ds=(c!=1);
			   es=(d==1);
			   if(bb(a,as)==1&&bb(b,bs)&&bb(c,cs)==1&&bb(d,ds)==1&&bb(e,es)==1)			  
					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++)
		for(b=1;b<=5;b++)
			if (b!=a)
				for(c=1;c<=5;c++)
					if (c !=b &&c!=a)
						for(d=1;d<=5;d++)
							if (d!=a&&d!=b&&d!=c)
								{
					e = 15-a-b-c-d;
					if((e == 2)||( e ==3))
						continue;
	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!=3 &&b*B!=3&&c*C!=3&&d*D!=3&&e*E!=3)
		cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
							}
	return 0;
}