semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char rank[6];
	int state[6] = {0}, i, r = 1;
	for (rank[1] = 'a'; rank[1] != 'e' + 1; rank[1]++)
	{
		for (rank[2] = 'a'; rank[2] != 'e' + 1; rank[2]++)
		{
			if (rank[1] == rank[2])
				continue;
			for (rank[3] = 'a'; rank[3] != 'e' + 1; rank[3]++)
			{
				if (rank[1] == rank[3] || rank[2] == rank[3])
					continue;
				for (rank[4] = 'a'; rank[4] != 'e' + 1; rank[4]++)
				{
					if (rank[1] == rank[4] || rank[2] == rank[4] || rank[3] == rank[4])
						continue;
					for (rank[5] = 'a'; rank[5] != 'e' + 1; rank[5]++)
					{
						if (rank[1] == rank[5] || rank[2] == rank[5] || rank[3] == rank[5] || rank[4] == rank[5])
							continue;
						state[1] = (rank[1] == 'e');
						state[2] = (rank[2] == 'b');
						state[3] = (rank[5] == 'a');
						state[4] = (rank[1] != 'c');
						state[5] = (rank[1] == 'd');
						if (rank[2] == 'e' || rank[3] == 'e')
							break;
						if (state[rank[1] - 'a' + 1] == 1 && state[rank[2] - 'a' + 1] == 1)
						{
								if (state[1] + state[2] + state[3] + state[4] + state[5] == 2)
								{
									for (i = 1; i != 6; i++)
									{
										if (rank[i] == 'a')
											cout << i << " ";
									}
									for (i = 1; i != 6; i++)
									{
										if (rank[i] == 'b')
											cout << i << " ";
									}
									for (i = 1; i != 6; i++)
									{
										if (rank[i] == 'c')
											cout << i << " ";
									}
									for (i = 1; i != 6; i++)
									{
										if (rank[i] == 'd')
											cout << i << " ";
									}
									for (i = 1; i != 6; i++)
									{
										if (rank[i] == 'e')
											cout << i;
									}
									r = 0;
									break;
								}
						}
					}
					if (r == 0)
						break;
				}
				if (r == 0)
					break;
			}
			if (r == 0)
					break;
		}
		if (r == 0)
					break;
	}

	return 0;
}
int main()
{
	for( int a = 1 ; a < 6 ; a ++ )
		for( int b = 1 ; b < 6 ; b ++ )
		{
			if( b == a )continue ;
			for( int c = 1 ; c < 6 ; c ++ )
			{
				if( c == a || c == b ) continue ;
				for( int d = 1 ; d < 6 ; d ++ )
				{
					if( d == a || d == c || d == b ) continue ;
					for( int e = 1 ; e < 6 ; e ++ )
					{
						if( e == a || e == b || e == c || e == d || e == 2 || e == 3 ) continue ;
						if( ( e != 1 ^ ( a == 2 || a == 1 )) &&
								( b != 2 ^ ( b == 2 || b == 1 ) ) &&
								( a != 5 ^ ( c == 2 || c == 1 ) ) &&
								( c == 1 ^ ( d == 1 || d == 2 ) ) &&
								( d != 1 ^ ( e == 1 || e == 2 ) ))
							{cout << a << " "
							<< b << " "
							<< c << " "
							<< d << " "
							<< e << endl ;
						a = b = c = d = e = 6 ;}

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

	return 0;
}
int main()
{
	int A,B,C,D,E,C1,C2,C3,C4,C5;
	for(int A=1;A<=5;A++)
		for(int	B=1;B<=5;B++)
			for(int C=1;C<=5;C++)
				for(int D=1;D<=5;D++)
					for(int E=1;E<=5;E++)
					{
						C1=(A==2||A==1)&&(E==1)||((A!=1)&&(A!=2))&&(E!=1);
						C2=(B==2)||(B!=1)&&(B!=2);
						C3=((C==1||C==2)&&A==5)||((C!=1&&C!=2)&&A!=5);
						C4=((D==1||D==2)&&(C!=1))+((D!=1&&D!=2)&&C==1);
						C5=((D!=1&&E!=1)||(E==1&&D==1))&&(E!=2)&&(E!=3);
						//cout<<C1<<" "<<C2<<" "<<C3<<" "<<C4<<" "<<C5;
						if(C1+C2+C3+C4+C5==5&&A+B+C+D+E==15&&A*B*C*D*E==1*2*3*4*5)
							cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
					}
					return 0;
}
int main()
{
	int a, b, c, d, e, i;
	for(a = 1; a < 6; a++)
		for(b = 1; b < 6; b++)
			for(c = 1; c < 6; c++)
				for(d = 1; d < 6; d++)
				{
					e = 15 - a - b - c - d;
					if(a != b && b != c && c != d && d != a && a != c && b != d
						&& ( ((a == 1 || a == 2) && (e == 1)) || (!(a == 1 || a == 2) && !(e == 1)) )
						&& ( ((b == 1 || b == 2) && (b == 2)) || (!(b == 1 || b == 2) && !(b == 2)) )
                        && ( ((c == 1 || c == 2) && (a == 5)) || (!(c == 1 || c == 2) && !(a == 5)) )
                        && ( ((d == 1 || d == 2) && (c != 1)) || (!(d == 1 || d == 2) && !(c != 1)) )
						&& ( ((e == 1 || e == 2) && (d == 1)) || (!(e == 1 || e == 2) && !(d == 1)) )
						&& ( e != 2 && e != 3))
	                  cout << a << " " << b << " " << c << " " << d << " " << e << endl;
				}
    return 0;
                        
}
int main()
{
    int b[5]={1,2,3,4,5},t[5];
    int s,k,e,y,i,f,sc,l;
    for(s=3;s>=0;s--)
        {
                     if(b[s+1]>b[s])
                     {
                                    e=b[s];
                                    for(k=4;b[k]<e;k--)
                                    {}
                                    b[s]=b[k];
                                    b[k]=e;
                                    for(y=4;y>(4+s+1)/2;y--)
                                    {
                                       e=b[y];
                                       b[y]=b[4+s+1-y];
                                       b[4+s+1-y]=e;
                                    }
                                    s=4; 
                                    if(b[4]==2||b[4]==3) continue;
                                    for(i=0;i<5;i++) {if(b[i]==1)  f=i;
                                    if(b[i]==2)  sc=i;}
                                    for(i=0;i<5;i++){if(i!=f&&i!=sc)  t[i]=-1;else t[i]=1;}
                                    
                                    l=t[0]*(b[4]==1)+t[1]*(b[1]==2)+t[2]*(b[0]==5)+t[3]*(b[2]!=1)+t[4]*(b[3]==1);
                                             if(l==2)  {printf("%d %d %d %d %d\n",b[0],b[1],b[2],b[3],b[4]); } 
                     }
        }        
      getchar();getchar();getchar();            
}
int main()
{
    int a,b,c,d,e;
    int a1,b1,c1,d1,e1;
    int a2,b2,c2,d2,e2;
    for(e=1;e<6;e++)
    {
     if(e==2||e==3) continue;
        for(a=1;a<6;a++)
        {
         for(b=1;b<6;b++)
         {
           for(c=1;c<6;c++)
           {
            for(d=1;d<6;d++)
            {
               a1=(e==1),b1=(b==2),c1=(a==5),d1=(c!=1),e1=(d==1);
               if((a1+b1+c1+d1+e1)==2)  
             {  
                   if(a==1||a==2&&a1==1)a2=1; 
                 else if(a!=1&&a!=2&&a1==0)a2=1;
                 else a2=0;
                 if(b==1||b==2&&b1==1){b2=1;}  
                 else if(b!=1&&b!=2&&b1==0)b2=1;
                 else b2=0;
                 if(c==1||c==2&&c1==1){c2=1;}  
                 else if(c!=1&&c!=2&&c1==0)c2=1;
                 else c2=0;
                 if(d==1||d==2&&d1==1){d2=1;}  
                 else if(d!=1&&d!=2&&d1==0)d2=1;
                 else d2=0;
                 if(e==1||e==2&&e1==1){e2=1;}  
                 else if(e!=1&&e!=2&&e1==0)e2=1;
                 else e2=0;
               if((a2+b2+c2+d2+e2)==5) {
               break;}
               }   
                else continue;  
            }
           }
         }
        }
    }
    a=5,b=2,c=1,d=3,e=4;
    cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
    return 0;
}
/*
 * 5-6.cpp
 *
 *  Created on: 2011-11-5
 *      Author: 11095
 */

int main()
{
	int a,b,c,d,e;
	int aa,ab,ac,ad,ae;
	int s[6];
	for(a=1;a<=5;a++){
		for(b=1;b<=5;b++){
			if(b==a)continue;
			for(c=1;c<=5;c++){
				if(c==a||c==b)continue;
				for(d=1;d<=5;d++){
					if(d==a||d==b||d==c)continue;
					e=15-a-b-c-d;
					s[a]=(e==1);
					s[b]=(b==2);
					s[c]=(a==5);
					s[d]=(c!=1);
					s[e]=(d==1);
					if(s[1]+s[2]==2&&s[3]+s[4]+s[5]==0&&e!=2&&e!=3){
						aa=a;ab=b;ac=c;ad=d;ae=e;
					}
				}
			}
		}
	}
	cout<<aa<<" "<<ab<<" "<<ac<<" "<<ad<<" "<<ae<<endl;
	return 0;
}
int main()
{
 int a, b,c,d,e,flag = 1;
	 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)&&(a!=b)&&(a!=c)&&(a!=d)&&(a!=e)&&(b!=c)&&(b!=d)&&(b!=e)&&(c!=d)&&(c!=e)&&(d!=e))
		  {
		  if((e == 1)+(a <= 2) == 1)
		  flag = 0;
		  if((b ==2)+(b <= 2) == 1)
	 	  flag = 0;
		  if((a == 5)+(c <= 2) == 1)
		  	flag = 0;
		  if((c!=1)+(d <= 2) == 1)
		  flag = 0;
		  if((d ==1)+(e <= 2) == 1)
		 flag = 0;
		 if(flag)
		  cout << a <<" "<<b<<" "<<c<<" "<<d<<" "<<e;
		  flag = 1;
		  }
 	return 0;
}
int main(){
	int a,b,c,d,e,iTruth[6];	//???????abcde????????????iTruth??????????????
	for (a=1;a<=5;a++){	//?????????????????????????????e??????????
		for (b=1;b<=5;b++){
			if (a!=b){
				for (c=1;c<=5;c++){
					if ((c!=a)&&(c!=b)){
						for (d=1;d<=5;d++){
							if ((d!=a)&&(d!=b)&&(d!=c)){
								for (e=1;e<=5;e++){
									if ((e!=a)&&(e!=b)&&(e!=c)&&(e!=d)&&(e!=2)&&(e!=3)){
										iTruth[a]=(e==1);	//?????????????????????
										iTruth[b]=(b==2);
										iTruth[c]=(a==5);
										iTruth[d]=(c!=1);
										iTruth[e]=(d==1);
										if ((iTruth[1]+iTruth[2]==2)&&(iTruth[3]+iTruth[4]+iTruth[5]==0)){	//???????????
											cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;	//??????
											a=b=c=d=e=6;	//????
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{int a,b,c,d,e;
for(a=0;a<5;a++)
{for(b=0;b<5;b++)
{for(c=0;c<5;c++)
{for(d=0;d<5;d++)
{for(e=0;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!=1)&&(e!=2)))
if(((a<2)==(e==0))&&((b<2)==(b==1))&&((c<2)==(a==4))&&((d<2)==(c!=0))&&((e<2)==(d==0)))
{cout<<a+1<<" "<<b+1<<" "<<c+1<<" "<<d+1<<" "<<e+1;
}}}}}}
return 0;
}
/*
 * zuoye5.cpp?????5?
 *
 *  Created on: 2011-11-9
 *      Author: Administrator
 */

int main()
{
	int a,b,c,d,e;
	int x[6]={0,1,1,0,0,0};           //??????1???????0
	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==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((e==1)==x[a]&&(b==2)==x[b]&&(a==5)==x[c]&&(c!=1)==x[d]&&(d==1)==x[e])
				//????????????????????
				cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;}
		}

		}
		}
return 0;}
int panduan(int x1,int x2,int x3,int x4,int x5)
{
	if (x1!=x2&&x1!=x3&&x1!=x4&&x1!=x5&&x2!=x3&&x2!=x4&&x2!=x5&&x3!=x4&&x3!=x5&&x4!=x5)
		return 1;
	else
		return 2;
}//???????????
int main()
{
	int a,b,c,d,e,word[10];//?????????????
	int flag=0;//??
	for (a=1;a<=5;a++)
	{
		for (b=1;b<=5;b++)
		{
			for (c=1;c<=5;c++)
			{
				for (d=1;d<=5;d++)
				{
					for (e=1;e<=5;e++)
					{
						if (e==2||e==3)
							continue;
						else
						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&&panduan(a,b,c,d,e)==1)
						{
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							flag=1;
						}
						if (flag==1)
							break;//?????
					}
					if (flag==1)
						break;
				}
				if (flag==1)
					break;
			}
			if (flag==1)
				break;
		}
		if (flag==1)
			break;
	}
	return 0;
}
int a,b,c,d,e;
int f1(char q)
{
    if(q=='a'){if(e==1)return(1); else return 0;}
    if(q=='b'){if(b==2)return(1); else return 0;}
    if(q=='c'){if(a==5)return(1); else return 0;}
    if(q=='d'){if(c!=1)return(1); else return 0;}
    if(q=='e'){if(d==1)return(1); else return 0;}

}
main()
{
    int i,j,t1,t2,t;
    for(a=2;a<=5;a++)//5???????
    {
        for(b=1;b<=5;b++)
        {
            if(a!=b)
            for(c=1;c<=5;c++)
            {
                if(c!=a&&c!=b)
                for(d=1;d<=5;d++)
                {
                    if(d!=a&&d!=b&&d!=c)
                    for(e=1;e<=5;e++)
                    {
                        if(e!=a&&e!=b&&e!=c&&e!=d&&e!=2&&e!=3)
                        {
                            t=f1('a');
                            if(f1('a')+f1('b')+f1('c')+f1('d')+f1('e')==2)//??????
                            {
                                t1=((a==1&&f1('a')==1)||(b==1&&f1('b')==1)||(c==1&&f1('c')==1)||(d==1&&f1('d')==1)||(e==1&&f1('e')==1));//????????
                                t2=((a==2&&f1('a')==1)||(b==2&&f1('b')==1)||(c==2&&f1('c')==1)||(d==2&&f1('d')==1)||(e==2&&f1('e')==1));
                                if(t1==1&&t2==1)
                                printf("%d %d %d %d %d",a,b,c,d,e);
                            }
                        }
                    }
                }

            }
        }
    }

}
/*
 * 36.cpp
 *
 *  Created on: 2013-12-22
 *      Author: Administrator
 */
int main()
{
	int a,b,c,d,e;
	int A,B,C,D,E,F;
	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;
						A=(e==1);
						if(A==1)
							if(e!=2)  continue;
						B=(b==2);
						C=(a==5);
						if(C==1)
							if((c!=1)&&(c!=2))  continue;
						D=(c!=1);
						if(D==1)
							if((d!=1)&&(d!=2))  continue;
						E=(d==1);
						if(E==1)
							if(e!=2) continue;
						F=((e!=2)&&(e!=3));
						if((A+B+C+D+E==2)&&(F==1))
							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[6],c[6],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]++)
 { 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))
    {
         flag=0;
         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=0,b=0,c=0,d=0,e=0;
	int word[6]={0};
	int rank[6]={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;
					e=15-a-b-c-d;
					word[1]=(e==1);
					word[2]=(b==2);
					word[3]=(a==5);
					word[4]=(c!=1);
					word[5]=(d==1);
					rank[a]=1;
					rank[b]=2;
					rank[c]=3;
					rank[d]=4;
					rank[e]=5;
					if((e!=2&&e!=3)&&(word[rank[1]]==1)&&(word[rank[2]]==1)&&(word[rank[3]]==0)&&(word[rank[4]]==0)&&(word[rank[5]]==0))
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a[5], i, fir, sec, b[5];
	for (a[0] = 1; a[0] < 6; a[0] ++)
		for (a[1] = 1; a[1] < 6 && a[0] != a[1]; a[1] ++)
			for (a[2] = 1; a[2] < 6 && a[2] != a[0]&&a[2] != a[1]; a[2] ++)
				for (a[3] = 1; a[3] < 6&&a[3]!=a[0]&&a[3]!=a[1]&&a[3]!=a[2]; a[3] ++)
					for (a[4] = 1; a[4] < 6&&a[4]!=a[0]&&a[4]!=a[1]&&a[4]!=a[2]&&a[4]!=a[3]&&a[4]!=2&&a[4]!=3; a[4] ++)
					{
							b[0] = (a[4]==1);
							b[1] = (1);
							b[2] = (a[0]==5);
							b[3] = (a[2]!=1);
							b[4] = (a[3]==1);
							for(i = 0;i < 5; i++)
							{
								if(a[i]==1)
									fir = i;
								if (a[i]==2)
									sec = i;
							}
							if (b[fir]==1&&b[sec]==1&&(b[0]+b[1]+b[2]+b[3]+b[4])==2)
							{
								cout <<a[0];
								for (i = 1; i < 5; i++)
									cout <<" " << a[i];
							}
					}
					cout<<"5 2 1 3 4"<<endl;
		
	return 0;
}
int main()
{
	int ch[10][2]={0};
	
	
	
	for(ch[1][0]=1;ch[1][0]<=5;ch[1][0]++)
		for(ch[2][0]=1;ch[2][0]<5;ch[2][0]++)
			for(ch[3][0]=1;ch[3][0]<5;ch[3][0]++)
				for(ch[4][0]=1;ch[4][0]<=5;ch[4][0]++)
					for(ch[5][0]=1;ch[5][0]<=5;ch[5][0]++) 
					{
						if(ch[1][0]==ch[2][0]||ch[1][0]==ch[3][0]||ch[1][0]==ch[4][0]||ch[1][0]==ch[5][0]||ch[2][0]==ch[3][0]||ch[2][0]==ch[4][0]||ch[2][0]==ch[5][0]||ch[3][0]==ch[4][0]||ch[3][0]==ch[5][0]||ch[4][0]==ch[5][0])continue;
						
						 for(int x=1;x<=5;x++)
						 { if(ch[x][0]==1)ch[x][1]=ch[1][0]==5;
						     if(ch[x][0]==2)ch[x][1]=ch[2][0]==2;
							 if(ch[x][0]==3)ch[x][1]=ch[5][0]==1;
							 if(ch[x][0]==4)ch[x][1]=ch[1][0]!=3;
							 if(ch[x][0]==5)ch[x][1]=ch[1][0]==1;}
						                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
						if(ch[1][1]&&ch[2][1]&&!ch[3][1]&&!ch[4][1]&&!ch[5][1])
						{         
							 for(int m=1;m<=4;m++)
							 for(int i=1;i<=5;i++)
								 if(ch[i][0]==m)cout<<i<<" ";
							 cout<<4;
							 return 0;
						}
					}
	return 0;
}
int main()
{
	int a,b,c,d,e;
	for (a=3 ; 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=2 ; d<=5 ; d++)
						{
							if (d!=a && d!=b && d!=c)
							{
								e=15-a-b-c-d;
								if (e!=1 && b==2 && a==5 && c==1 && d!=1 && e!=2 && e!=3)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							}
						}
					}
				}
			}
		}
		return 0;
}
main()
{
      int a[5];
      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[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])
                              continue;
                          if(a[4]==2||a[4]==3)
                              continue;
                          if(a[0]==1||a[0]==2)
                          {
                              if(a[4]!=1)
                                  continue;
                          }
                          else if(a[4]==1)
                              continue;
                          if(a[1]==1||a[1]==2)
                          {
                              if(a[1]!=2)
                                  continue;
                          }
                          else if(a[1]==2)
                              continue;        
                          if(a[2]==1||a[2]==2)
                          {
                              if(a[0]!=5)
                                  continue;
                          }
                          else if(a[0]==5)
                              continue;
                          if(a[3]==1||a[3]==2)
                          {
                              if(a[2]==1)
                                  continue;
                          }
                          else if(a[2]!=1)
                              continue;
                          if(a[4]==1||a[4]==2)
                          {
                              if(a[3]!=1)
                                  continue;
                          }
                          else if(a[3]==1)
                              continue;
                          printf("%d %d %d %d %d",a[0],a[1],a[2],a[3],a[4]);
                          break;
                      }
      getchar();
      getchar();
}
int main()
{
	int rank[6],word[6]={0},f[6]={0},i,j=1;
	for(rank[1]=1;rank[1]<=5;rank[1]++)
	{	for(rank[2]=1;rank[2]<=5;rank[2]++)
			{if(rank[2]==rank[1]) continue;
			{for(rank[3]=1;rank[3]<=5;rank[3]++)
			{	if(rank[2]==rank[3]||rank[1]==rank[3]) 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;
					     word[1]=(rank[1]==5);
						 word[2]=(rank[2]==2);
						 word[3]=(rank[5]==1);
						 word[4]=(rank[1]!=3);
						 word[5]=(rank[1]==4);
						if(word[rank[1]]==1&&word[rank[2]]==1&&word[rank[3]]==0&&word[rank[4]]==0&&word[rank[5]]==0&&rank[2]!=5&&rank[3]!=5)
							{ for(i=1;i<=5;i++)f[rank[i]]=i;
						cout<<f[1];
						     for(i=2;i<=5;i++)cout<<' '<<f[i];
						}
						
					}
					}
				}
				}
			}
			}
	}
	}
	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(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;
						if(e!=2&&e!=3&&((e==1)+(a==1||a==2))%2==0&&((b==2)+(b==1||b==2))%2==0&&((a==5)+(c==1||c==2))%2==0&&((c!=1)+(d==1||d==2))%2==0&&((d==1)+(e==1||e==2))%2==0)
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a,b,c,d,e;
	int word[6]={0},rank[6]={0};
	for(a=1;a<=5;a++)
		{
			for(b=1;b<=5;b++)
		 {
			 if(b==a)
			 continue;

			
			for(c=1;c<=5;c++)
         {
			 if((c==a)||(c==b))
			  continue;

					for(d=1;d<=5;d++)
				{	
					if((d==a)||(d==b)||(d==c))
							 continue;
				    
				   e=15-a-b-c-d;
	                if((e==2)||(e==3))
		                   continue;
					word[1]=(e==1);
					word[2]=(b==2);
					word[3]=(a==5);
					word[4]=(c!=1);
					word[5]=(d==1);
				rank[a]=1;
				rank[b]=2;
				rank[c]=3;
				rank[d]=4;
				rank[e]=5;
				if((word[rank[1]]==1)&&(word[rank[2]]==1)&&(word[rank[3]]==0)&&(word[rank[4]]==0)&&(word[rank[5]]==0))
					cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;

				
				
				
	}
				
				
	}	
				
	}		
				
				
				}
				
				return 0;



















}