semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int flag=0;
char t[6], ok[6];
int f[6];

int yes()
{
    int i;
    for(i=0; i<2; i++)
    {
        switch(t[i])
        {
            case 'A': return 0;
            case 'B': if(i!=1) return 0; else break;
            case 'C': if(t[4]!='A') return 0; else break;
            case 'D': if(t[0]=='C') return 0; else break;
            case 'E': if(t[0]!='D') return 0; else break;
        }
    }
    for(i=2; i<5; i++)
    {
        switch(t[i])
        {
            case 'A': if(t[0]=='E') return 0; else break;
            case 'B': break;
            case 'C': if(t[4]=='A') return 0; else break;
            case 'D': if(t[0]!='C') return 0; else break;
            case 'E': if(t[0]=='D') return 0; else break;
        }
    }
    return 1;
}

int work(int k)
{
    if(flag==1) return 0;
    int i;
    if(k==6)
    {
        if(yes()==1)
        {
            for(i=0;i<5;i++)
                ok[i]=t[i];
            ok[6]='\0';
            flag=1;
        }
        return 0;
    }
    for(i=0; i<5; i++)
    {
        if(f[i]==1) continue;
        if(k==1)
        {
            if(i==0 || i==4) continue;
        }
        if(i==4)
        {
            if(k==2 || k==3) continue;
        }
        t[k-1]='A'+i;t[k]='\0';
        f[i]=1;
        work(k+1);
        f[i]=0;
        t[k-1]='\0';
        if(flag==1) return 0;
    }
    return 0;
}

int main()
{
    int ans[6];
    int i;
    memset(f, 0, sizeof(f));
    work(1);
    for(i=0; i<5; i++)
    {
        ans[ok[i]-'A']=i+1;
    }
    for(i=0; i<4; i++)
        printf("%d ", ans[i]);
    printf("%d\n", ans[4]);
    return 0;
}
/*
??:???
??:1300012974
??:????
*/
int main()
{
	int A, B, C, D, E, 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;
					for(E=1;E<6;E++)
					{if(E==A||E==B||E==C||E==D)continue;
						if(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==2)
								if(E!=1)break;
							if(B==1||B==2)
								if(B!=2)break;
							if(C==1||C==2)
								if(A!=5)break;
							if(D==1||D==2)
								if(C==1)break;
							if(E==1||E==2)
								if(D!=1)break;
							cout <<A << " "<< B<< " " <<C <<" "<<D<<" "<<E;
						}
					}
				}
			}
		}
	}

	



	return 0;
}
int main()
{
   int a[6],flag[6],i,count;                                               //a??????,flag ?????????          
   
  for(a[5]=4;a[5]<=5;a[5]++)
  {
      for(a[1]=1;a[1]<=5;a[1]++)
	  {
	      if(a[1]==a[5])continue;
		  else
		  {
              for(a[3]=1;a[3]<=5;a[3]++)
			  {
			       if(a[3]==a[5]||a[3]==a[1])continue;
				   else
				   {
				        for(a[4]=1;a[4]<=5;a[4]++)
						{
						     if(a[4]==a[3]||a[4]==a[5]||a[4]==a[1])continue;
							 else
							 {
							      a[2]=15-a[1]-a[5]-a[3]-a[4];
								  flag[1]=2-a[5];
                                   flag[2]=3-a[2];
                                 flag[3]=6-a[1];
                                   flag[4]=(a[3]>1);
                                  flag[5]=2-a[4];
								  count=1;                                       //count????????
								  for(i=1;i<=5;i++)
								  {
									  if(a[i]==1||a[i]==2)
									  {
									     if(flag[i]!=1)
											 count=0;
										 
									  }
									  else
									  {
									      if(flag[i]==1)
											  count=0;
									  }
                                  }
								  if(count==1)
								  {
									  for(i=1;i<=4;i++)
	                                    cout<<a[i]<<' ';
									  cout<<a[5];
								  }
								  
							 }
						}
				   }
			  }
		  }
	  }
  }
  a[5]=1;
  for(a[1]=2;a[1]<=5;a[1]++)
	  {
              for(a[3]=2;a[3]<=5;a[3]++)
			  {
			       if(a[3]==a[1])continue;
				   else
				   {
				        for(a[4]=2;a[4]<=5;a[4]++)
						{
						     if(a[4]==a[3]||a[4]==a[1])continue;
							 else
							 {
							      a[2]=15-a[1]-a[5]-a[3]-a[4];
								  flag[1]=2-a[5];

   flag[2]=3-a[2];
   flag[3]=6-a[1];
   flag[4]=(a[3]>1);
   flag[5]=2-a[4];
								  count=1;
								  for(i=1;i<=5;i++)
								  {
									  if(a[i]==1||a[i]==2)
									  {
									     if(flag[i]!=1)
											 count=0;
										 
									  }
									  else
									  {
									      if(flag[i]==1)
											  count=0;
									  }
                                  }
								  if(count==1)
								  {
									  for(i=1;i<=4;i++)
	                                    cout<<a[i]<<' ';
									  cout<<a[5];
								  }
							 }
						}
				   }
			  }
		  
	  
  }
  
  return 0;
}
int main()
{
	int a, b, c, d, e;
	int aS, bS, cS, dS, eS;
	int sum, pro;

	for (e = 1; e <= 5; e++)
	{
		if (e == 2 || e == 3) continue;
		for (a = 1; a <= 5; a++)
		{
			if (e == a) continue;
			for (b = 1; b <= 5; b++)
			{
				if (e == b || a == b) continue;
				for (c = 1; c <= 5; c++)
				{
					if (e == c || a == c || b == c) continue;
					for (d = 1; d <= 5; d++)
					{
						if (e == d || a == d || b == d || c == d) continue;
						aS = (e == 1);
						bS = (b == 2);
						cS = (a == 5);
						dS = (c != 1);
						eS = (d == 1);
						sum = (a-aS) + (b-bS) + (c-cS) + (d-dS) + (e-eS);
						pro = (a-aS) * (b-bS) * (c-cS) * (d-dS) * (e-eS);
						if (sum == 13 && pro == 0 && (a-aS == 1 || b-bS == 1 || c-cS == 1 || d-dS == 1 || e-eS == 1))
							cout << a << " " << b << " " << c << " " << d << " " << e << endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int N[5],M[5];
	for( N[0]=1;N[0]<6;N[0]++)
		for( N[1]=1;N[1]<6;N[1]++)
			if(N[0]!=N[1])
			{
				for(N[2]=1;N[2]<6;N[2]++)
					if(N[2]!=N[0]&&N[2]!=N[1])
					{
						for(N[3]=1;N[3]<6;N[3]++)
							if(N[3]!=N[0]&&N[3]!=N[1]&&N[3]!=N[2])
							{
								for( N[4]=1;N[4]<6;N[4]++)
								{
									if(N[4]!=N[0]&&N[4]!=N[1]&&N[4]!=N[2]&&N[4]!=N[3]&&N[4]!=2&&N[4]!=3)
									{
										M[0]=(N[4]==1);
										M[1]=(N[1]==2);
										M[2]=(N[0]==5);
										M[3]=(N[2]!=1);
										M[4]=(N[3]==1);
										if(M[1]+M[2]+M[3]+M[4]+M[0]==2)
										{
											int s=0;
											for(int i=0;i<5;i++)
											{
												if(M[i]==1&&(N[i]==1||N[i]==2))
													s++;
											}
												if(s==2)
												{
													for(int j=0;j<4;j++)
														cout<<N[j]<<" ";
														cout<<N[4]<<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++)
for(c=1;c<=5;c++)
for(d=1;d<=5;d++)
for(e=1;e<=5;e++)

{
	if(
		(((e==1)&&(a==1||a==2))||((e!=1)&&(a!=1)&&(a!=2)))
		&&
		(((b==2)&&(b==1||b==2))||((b!=2)&&(b!=1)&&(b!=2)))
		&&
		(((a==5)&&(c==1||c==2))||((a!=5)&&(c!=1)&&(c!=2)))
		&&
		(((c!=1)&&(d==1||d==2))||((c==1)&&(d!=1)&&(d!=2)))
		&&
		(((d==1)&&(e==1||e==2))||((d!=1)&&(e!=1)&&(e!=2)))
		&&
		(e!=2)
		&&
		(e!=3)
		&&
		((a-b)*(b-c)*(c-d)*(d-e)*(a-c)*(a-d)*(a-e)*(b-d)*(b-e)*(c-e)!=0)    //????????????
		)

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

												    }
							}
	return 0;
}
int main(){
	int a[5],c[5],d[5],i,j;
	for(a[0]=1;a[0]<=5;a[0]++)
	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]++){
		if(a[4]!=2&&a[4]!=3&&a[0]!=a[1]&&a[0]!=a[2]&&a[0]!=a[3]
		&&a[0]!=a[4]&&a[1]!=a[2]&&a[1]!=a[3]&&a[1]!=a[4]&&a[2]!=a[3]&&a[2]!=a[4]&&a[3]!=a[4]){
			c[0]=(a[4]==1);
			c[1]=(a[1]==2);
			c[2]=(a[0]==5);
			c[3]=(a[2]!=1);
			c[4]=(a[3]==1);
			for(i=0;i<5;i++){
				d[i]=a[i]+c[i];
			} 
			sort(d,d+5);
			if(d[0]==2&&d[1]==3&&d[2]==3&&d[3]==4&&d[4]==5){
				for(i=0;i<4;i++) printf("%d ",a[i]);
				printf("%d\n",a[i]); 
			
			}
		} 
	}
	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]++)
		   for (a[3]=1;a[3]<=5;a[3]++)
		     for (a[4]=1;a[4]<=5;a[4]++)
		       for (a[5]=1;a[5]<=5;a[5]++)
		       {
				 if (a[1]!=a[2]&&a[1]!=a[3]&&a[1]!=a[4]&&a[1]!=a[5]
				 &&a[2]!=a[4]&&a[2]!=a[3]&&a[2]!=a[5]&&a[3]!=a[5]&&a[3]!=a[4]
				 &&a[4]!=a[5]&&a[5]!=2&&a[5]!=3&&a[1]==5&&a[2]==2&&a[3]==1&&a[4]==3&&a[5]==4&&(((a[1]==1||a[1]==2)&&a[5]==1)+((a[2]==1||a[2]==2)&&a[2]==2)+((a[3]==1||a[3]==2)&&a[1]==5)+
						((a[4]==1||a[4]==2)&&a[3]>1)+((a[5]==1||a[5]==2)&&a[4]==1)==2))
				 {
						 
							cout << a[1] << ' '<< a[2] << ' '<< a[3] << ' '<< a[4] << ' '<< a[5];
							break;
					}
			   }
    cin.get();
    cin.get();
	return 0;
}
int main()
{  int pai(int a[5]);
   int a[5],i,j,k,l,m,t;
   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(pai(a)==1)
			    {for(t=0;t<5;t++)
				   {printf("%d",a[t]);
				     if(t<4) printf(" ");
				   }
				   break;
				   
				}
			  }
		   }
		}	  
	  }
   }

	return(0);
}
int pai(int a[5])
{ int num=0,i,j;
  for(i=0;i<5;i++)
  { for(j=i+1;j<5;j++)
      { if(a[i]==a[j])
          return(0);
			}
		}
	if(a[4]!=2&&a[4]!=3) 
	{if(a[4]==1)
	{ if(a[0]==2)
	   num++;
	   else 
	   return(0);
		}
	 if(a[1]==2)
	 { if(a[1]==2)
	     num++;
	     else
	     return(0);
			}
	 if(a[0]==5)
	 { if(a[2]==1||a[2]==2)
	     num++;
	    else
	     return(0);
			}
	 if(a[2]!=1)
	 { if(a[3]==1||a[3]==2)
	    num++;
	    else
	     return(0);
			}	    
		}
	 if(a[3]==1)
	 { if(a[4]==2)
	     num++;
	     else
	     return(0);
			
			}
   if(num==2)
     return(1);
  return(0);
  
  
	
}
/*
 * 2.cpp
 *
 *  Created on: 2013-11-8
 *      Author: ???1300012996
 */
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==2||e==3)continue;if(e==a||e==b||e==c||e==d)continue;//e??2?3
    					 if((a==1||a==2)!=(e==1))continue;//???1?2 ?????????????
    					 if((b==1||b==2)!=(b==2))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;break;}
    				 }
    			 }
    		 }
    	 }
    }
	return 0;
}
int main()
{
	int a[5],l;
	for(int b=1;b<=5;b++)
	{
		a[0]=b;
		for(int c=1;c<=5;c++)
		{
			a[1]=c;
			if(a[0]==a[1])
				continue;
			for(int d=1;d<=5;d++)
			{
				a[2]=d;
				if(a[2]==a[1] || a[2]==a[0])
					continue;
				for(int e=1;e<=5;e++)
				{
					a[3]=e;
					if(a[3]==a[0] || a[3]==a[1] || a[3]==a[2])
					continue;
					a[4]=15-a[0]-a[1]-a[2]-a[3];
					int h[5];
					h[0]=(a[4]==1);
					h[1]=(a[1]==2);
					h[2]=(a[0]==5);
					h[3]=(a[2]!=1);
					h[4]=(a[3]==1);
					if(((a[4]==1)+(a[1]==2)+(a[0]==5)+(a[2]!=1)+(a[3]==1))==2)
					{
						if(((a[4]!=2)+(a[4]!=3))==2)
						{
							l=0;
							for(int f=0;f<=4;f++)
							{
								if((h[f]==1) && (a[f]==1 || a[f]==2))
									l=l+1;
							}
							if(l==2)
									cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<15-a[0]-a[1]-a[2]-a[3];
							}
						}
					}
				}
			}
		}
return 0;
}
int main ()
{
	int a=1,b=1,c=1,d=1,e=1,A,B,C,D,E;
	int a1,b1,c1,d1,e1;

	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)
		{
			continue;
		}
		else
		{
				a1=(a==1||a==2)+(e==1);
	            b1=(b==1||b==2)+(b==2);
	            c1=(c==1||c==2)+(a==5);
	            d1=(d==1||d==2)+(c!=1);
	            e1=(e==1||e==2)+(d==1);
			if (a1==1||b1==1||c1==1||d1==1||e1==1)
			{
				continue;
			}
			else
			{
				A=a,B=b,C=c,D=d,E=e;
			}
		}
		}
		}
		}
		}
	}
	cout<<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 (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&&e==1) continue;
						if ((a==1||a==2)&&e!=1) continue;
						if (b==1) continue;
						if (c!=1&&c!=2&&a==5) continue;
						if ((c==1||c==2)&&a!=5) continue;
						if (d!=1&&d!=2&&c!=1) continue;
						if ((d==1||d==2)&&c==1) continue;
						if (e!=1&&e!=2&&d==1) continue;
						if ((e==1||e==2)&&d!=1) continue;
						cout << a << ' ' << b << ' ' << c << ' ' << d << ' ' << e << endl;
					}
				}
			}
		}
	}}
int a[6];
int judge(int a,int b,int c,int d,int e)
{
    int i,g[6];
    for (i=1;i<=5;i++) g[i]=0;
    g[a]=1; g[b]=1; g[c]=1; g[d]=1; g[e]=1;
    for (i=1;i<=5;i++)
    if (g[i]==0) return 0;
    return 1;
}
int pd(int x)
{
    if (x==1) if (a[5]==1) return 1;
    else return 0;
    
    if (x==2) if (a[2]==2) return 1;
    else return 0;
    
    if (x==3) if (a[1]==5) return 1;
    else return 0;
    
    if (x==4) if (a[3]!=1) return 1;
    else return 0;
    
    if (x==5) if (a[4]==1) return 1;
    else return 0;
}
main()
{     int i,flag;
      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]++)
      for (a[5]=1;a[5]<=5;a[5]++)
      
      if ((judge(a[1],a[2],a[3],a[4],a[5])>0)&&(a[5]!=2)&&(a[5]!=3))
      { flag=0;
        for (i=1;i<=5;i++)
        { if (a[i]==1) if (pd(i)==0) flag=1;
          if (a[i]==2) if (pd(i)==0) flag=1;
          if (a[i]==3) if (pd(i)==1) flag=1;
          if (a[i]==4) if (pd(i)==1) flag=1;
          if (a[i]==5) if (pd(i)==1) flag=1;}
        if (flag==0) printf("%d %d %d %d %d\n",a[1],a[2],a[3],a[4],a[5]);
        }
        }
int main()
{
    int a[5]; //?? 
    int b[5],sum = 0, pin = 0; //????
    
    for ( a[0] = 1; a[0] <= 5; a[0]++ )
    {
        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]++ )
                    {
                        sum = 0;
                        pin = 0;
                        
                        if ( a[4]== 2 || a[4] == 3 )
                           continue;
                        
                        b[0] = ( a[4] == 1);
                        b[1] = ( a[1] == 2);
                        b[2] = ( a[0] == 5);
                        b[3] = ( a[2] != 1 );
                        b[4] = ( a[3] == 1);
                        
                        for ( int j = 0; j < 4; j++ )
                        {
                            for ( int k = j + 1; k <= 4; k++ )
                            {
                                if ( a[j] == a[k] )
                                   pin = 1;             
                            }
                                           
                        } 
                        
                        if ( pin == 1 )
                           continue;
                           
                        for ( int i = 0; i < 5; i++ )
                        {
                            if ( (a[i] == 1 && b[i] == 1))
                               sum++;
                            if (  a[i] == 2 && b[i] == 1)                         
                               sum++;
                            if ( b[i] == 1 &&( a[i] != 1 && a[i] != 2))
                            {
                                 sum = 0;
                                 break;
                            }
                        }
                       
                        if ( sum == 2 )
                        {   cout << a[0] << " "<< a[1] << " "<< a[2] << " "<< a[3] << " "<< a[4]; 
                        
                            return 0;
                        }
                    }
                }
            }
        }
    } 

    return 0;

}
int main()
{
	int ranka;
	int rankb;
	int rankc;
	int rankd;
	int ranke;
	int num=0;
	int a[6];
	int i;

		for(ranka=1;ranka<=5;ranka++)
		for(rankb=1;rankb<=5;rankb++)
			if(rankb!=ranka)
			for(rankc=1;rankc<=5;rankc++)
				if((rankc!=ranka)&&(rankc!=rankb))
				for(rankd=1;rankd<=5;rankd++)
					if((rankd!=ranka)&&(rankd!=rankb)&&(rankd!=rankc))
					for(ranke=1;ranke<=5;ranke++)
						if((ranke!=ranka)&&(ranke!=rankb)&&(ranke!=rankc)&&(ranke!=rankd))
				{
					a[ranka]=(ranke==1);
					a[rankb]=(rankb==2);
					a[rankc]=(ranka==5);
					a[rankd]=(rankc!=1);
					a[ranke]=(rankd==1);
					
					if(a[1]&&a[2]&&!a[3]&&!a[4]&&!a[5]&&ranke!=2&&ranke!=3)
						
						cout<<ranka<<" "<<rankb<<" "<<rankc<<" "<<rankd<<" "<<ranke;

				}
					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 + c + d + e) == 15) && ((a*b*c*d*e) == 120))
						{
							if ( (((a == 2) && (e == 1)) || ((a >= 3) && (e != 1)))&& 
								(b != 1) && 
								(e != 2) && 
								(e != 3) &&
								(((c <= 2) && (a == 5)) || ((c >= 3) && (a != 5))) &&
								(((d <= 2)  && ( c != 1)) || ((d >= 3) && (c == 1))) &&
								(((e <= 2) && ( d == 1)) || ((e >= 3) && (d != 1))) )
								cout << a << " " << b << " " << c << " " << d << " " << e;
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
    int a[6]={0};
    int cc[6]={0};
    int i=0,sum=0,cc1=0,cc2=0,cc3=0,cc4=0,cc5=0;
    for(a[1]=1;a[1]<6;a[1]++)
    {
        for(a[2]=1;a[2]<6;a[2]++)
        {
            if(a[2]==a[1])
            {
                 continue;         
            }             
            for(a[3]=1;a[3]<6;a[3]++)
            {
                if((a[3]==a[1])||(a[3]==a[2]))
                {
                      continue;                        
                }              
                for(a[4]=1;a[4]<6;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];
                     cc[a[1]]=(a[5]==1);
                     cc[a[2]]=(a[2]==2);
                     cc[a[3]]=(a[1]==5);
                     cc[a[4]]=(a[3]!=1);
                     cc[a[5]]=(a[4]==1);
                     sum=cc1+cc2+cc3+cc4+cc5; 
                     if((cc[1]==1)&&(cc[2]==1)&&(cc[3]==0)&&(cc[4]==0)&&(cc[5]==0)&&(a[5]!=2)&&(a[5]!=3))
                     {
                         cout<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<" "<<a[5];
                         break;                      
                     }                                                
                }       
            }        
        }                     
    }
 
    return 0;
}
int main()
{
	int a,b,c,d,e,c1,c2,c3,c4,c5;
	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==c||d==b||d==a) continue;
                    for(e=1;e<=5;e++)
					{
						if(e==2||e==3||e==a||e==b||e==c||e==d) continue;
						else
						{
							c1=(e==1);c2=(b==2);c3=(a==5);c4=(c!=1);c5=(d==1);
							if(c1+c2+c3+c4+c5==2)
							{
							if(c1+c2==2&&a+b==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c1+c3==2&&a+c==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c1+c4==2&&a+d==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c1+c5==2&&a+e==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c2+c3==2&&b+c==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c2+c4==2&&b+d==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c2+c5==2&&b+e==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c3+c4==2&&c+d==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c3+c5==2&&c+e==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							else if(c4+c5==2&&d+e==3)
								cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							}
						}
						}
					}
				}
			}
		}
						return 0;
					}
int main()
{
	int A,B,C,D,E;
	int words[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;
					E = 15 - A - B - C - D;
					if(E==2||E==3) continue;
					words[A]=(E==1);
					words[B]=(B==2);
					words[C]=(A==5);
					words[D]=(C!=1);
					words[E]=(D==1);
					if(words[1]==1&&words[2]==1&&words[3]+words[4]+words[5]==0)
						cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
				}
			}
		}
	}
	return 0;
}
int a[6];//????????1-5??ABCDE
int judge(int i)//??a[i]????
{
	if(i == 1)
	{
		if(a[5] == 1)
			return 1;
		else
			return 0;
	}
	else if(i == 2)
	{
		if(a[5] == 1)
		   return 1;
	    else
		   return 0;
	}
	else if(i == 3)
	{
		if(a[1] ==5)
		return 1;
	    else
		return 0;
    }
	else if(i == 4)
	{
		if(a[3]!=1)
		return 1;
	    else
		return 0;
	}
	else
	{
		if(a[4] ==1)
		return 1;
	else
		return 0;
	}
}
int search(int a[5])//???????????????1-5????
{
	for(int i = 1;i<=5;i++)
		for(int j = 1;j<=5;j++)
		{
			if(j == i)
			{
				j++;
				continue;
			}
			else
			{
				if(a[i] == a[j])
					return 0;
			}
		}
		return 1;
}
int main()
{
	 a[1] = 1;
	 a[2] = 2;
	 a[3] = 3;
	 a[4] = 4;
	 a[5] = 5;
	 while(1)
	 {
		 if(search(a))//??????????????
		 {
		 int p,q;
		 for(int i =1;i<=5;i++)
		 {
			 if(a[i] == 1) p = i;
			 else if(a[i] == 2) q = i;
		 }
		 int s;
		 s = 1;
		 for(s;s<=5;s++)
		 {
			 if((s == p)||(s==q))
			 {
				 if(judge(s) == 0)
					 break;
			 }
			 else
			 {
				 if(judge(s))
					 break;
			 }
		 }
		 if(s ==6)//???????????????
		 {
			 a[1] = 5;a[2] = 2;a[3] = 1;a[4] = 3;a[5]  = 4;
			 printf("%d %d %d %d %d",a[1],a[2],a[3],a[4],a[5]);
			 return 0;
		 }
		 else
		 {
			 if(a[5]<5)
				 a[5]++;
			 else
			 {
				 int x = 4;
				 while(x>=1)
				 {
					 if(a[x] <5)
					 {
						 int y = x+1;
						 a[x] ++;
						 while(y<=5)
						 {
							 a[y] = 1;
							 y++;
						 }
						 break;
					 }
					 x--;
				 }
			 }
		 }
		 }
		 else 
		 {
			 if(a[5]<5)
				 a[5]++;
			 else
			 {
				 int x = 4;
				 while(x>=1)
				 {
					 if(a[x] <5)
					 {
						 int y = x+1;
						 a[x] ++;
						 while(y<=5)
						 {
							 a[y] = 1;
							 y++;
						 }
						 break;
					 }
					 x--;
				 }
			 }
		 }
	 }
}