semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 * airconditionerranking___1114.cpp
 *?????????
 *  Created on: 2011-11-14
 *      Author: ???
 */
int main ()//?????
{
	int rank[6]={0};
	int a,b,c,d,e,A,B,C,D,E;//????
	for (e=1;e<=5;e++)
	{
		if ((e==2)||(e==3))//???????
			continue;
		for (a=1;a<=5;a++)
		{
			if (a==e)
				continue;//???????????
			for (b=1;b<=5;b++)
				{
				if ((b==a)||(e==b))
					continue;
				for (c=1;c<=5;c++)
				{
					if ((a==c)||(b==c)||(e==c))
						continue;
					for (d=1;d<=5;d++)
						{if ((a==d)||(b==d)||(c==d)||(e==d))
							continue;
						rank[a]=(e==1);   //??????????????????
						rank[b]=(b==2);
						rank[c]=(a==5);
						rank[d]=(c!=1);
						rank[e]=(d==1);
						if (((rank[1]+rank[2])==2)&&(rank[3]+rank[4]+rank[5]==0))//????????????
						{
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							a=b=c=d=e=6;
							break;
						}
						}
				}
				}
		}
	}
}
int main()
{
	int w[6];
	char r[6];
	int a,b,c,d,e,i;
	for(a=1;a<=5;a++)
		for(b=1;b<=5;b++)
		{
			if(b==a)continue;
			for(c=1;c<=5;c++)
			{
				if(c==a||c==b)continue;
				for(d=1;d<=5;d++)
				{
					if(d==a||d==b||d==c)continue;
					for(e=1;e<=5;e++)
					{
						if(e==a||e==b||e==c||e==d||e==2||e==3)continue;
						w[a]=(e==1);
						w[b]=(b==2);
						w[c]=(a==5);
						w[d]=(c!=1);
						w[e]=(d==1);
						if(w[1]==1&&w[2]==1&&w[3]==0&&w[4]==0&&w[5]==0)
						{
							r[a]='A';r[b]='B';r[c]='C';r[d]='D';r[e]='E';
							cout << a<<" ";
							cout << b<<" ";
							cout << c<<" ";
							cout << d<<" ";
							cout << e;

						}
					}
				}
			}
		}

	return 0;
}
int main()
{
	// ????????
	// ????????
	int i, j, k, l, m, n, flag, sum, p, q;
	int mc[6] = {0};
	int pd[6] = {0};
	for (mc[1] = 1; mc[1] <= 5; mc[1]++)
	{
		for (mc[2] = 1; mc[2] <= 5; mc[2]++)
		{
			if (mc[1] == mc[2]) continue;
			for (mc[3] = 1; mc[3] <= 5; mc[3]++)
			{
				if ((mc[3] == mc[2]) || (mc[3] == mc[1])) continue;
				for (mc[4] = 1; mc[4] <= 5; mc[4]++)
				{
					if ((mc[4] == mc[1]) || (mc[4] == mc[2]) || (mc[4] == mc[3])) continue;
					for (mc[5] = 1; mc[5] <= 5; mc[5]++)
					{
						if ((mc[5] == mc[1]) || (mc[5] == mc[2]) || (mc[5] == mc[3]) || (mc[5] == mc[4]))continue ;
						pd[1] = (mc[5] == 1 );
						pd[2] = (mc[2] == 2 );
						pd[3] = (mc[1] == 5);
						pd[4] = (mc[3] != 1) ;
						pd[5] = (mc[4] == 1); 
						flag = 0;
						sum = 0;
						for (j = 1; j <= 5; j++)
						{
							sum = sum + pd[j];
						}
						if (sum == 2)
						{
							for (i = 1; i <= 5; i++)
							{
								if (mc[i] == 1) p = i;
								if (mc[i] == 2) q = i;
							}
							if ((pd[p] == 1) && (pd[q] == 1) && (mc[5] != 2) && (mc[5] != 3)) 
							{
								cout << mc[1];
								for (i = 2; i <= 5; i++)
									cout << " " << mc[i];
								cout << 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)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 &&a==5&& word[4]==0 && word[5]==0)cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;;
			   }
			 }
		   }
		}
	return 0;
}
//?????
//??? 1200017623
//???????????


int main(){
	int a,b,c,d,e,word[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;
					word[a] = (e == 1);                 //a????A??????
					word[b] = (b == 2);
					word[c] = (a == 5);
					word[d] = (c != 1);
					word[e] = (d == 1);
					if(word[1] && word[2] && !word[3] && !word[4] && !word[5]){
						printf("%d %d %d %d %d\n",a,b,c,d,e);break;
					}
				}
			}
		}
	}
	return 0;
}
/*
 * ????.cpp
 *
 *  Created on: 2011-11-6
 *      Author: ??
 */
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))continue;//???E???2?3
					if ((A==B)||(A==C)||(A==D)||(A==E)||(B==C)||(B==D)||(B==E)||(C==D)||(C==E)||(D==E))continue;//??????????
					if (((((E!=1)&&((A==1)||(A==2)))+(((C==1)||(C==2))&&(A!=5))+(((B==1)||(B==2))&&(B!=2))+
							(((D==1)||(D==2))&&(C==1))+(((E==1)||(E==2))&&(D!=1)))==0)&&
							((E==1)+(A==5)+(C!=1)+(D==1)+(B==2)==2))//????
							{cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;exit(0);}
				}
			}
		}
	}
}
return 0;
}
int main()
{
	int a=1,b=1,c=1,d=1,e=1,as,bs,cs,ds,es;
	as = (e == 1);
	bs = (b == 2);
	cs = (a == 5);
	ds = (c != 1);
	es = (d == 1);
	// cout << as << bs << cs << ds << es;
	for (a = 1; a <= 5; a++)
		for (b = 1; b <= 5; b++)
			for (c = 1; c <= 5; c++)
				for (d = 1; d <= 5; d++)
					for (e = 1; e <= 5; e++)
						if (e!=2 && e != 3)
						{

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

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


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

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

							if (((d == 1) && (e == 2)) || ((d == 2) && (e == 1)))
							{
								if ((b==2)&&(d==1)&&(e!=1)&&(a!=5)&&(c==1))
								cout << a << " " << b << " " << c << " " << d << " " << e << endl;
							}
						}
	return 0;
}
int guess[5],used[5],place[5];
void find(int lev){
    int i;
    if (lev==5){
       if (guess[1]==4 || guess[2]==4 || guess[1]!=1) return;
       switch (guess[0]){
              case 0:
                   return;
              case 1:
                   break;
              case 2:
                   if (guess[4]!=0) return;
                   break;
              case 3:
                   break;
              case 4:
                   return;
       }
       switch (guess[1]){
              case 0:
                   if (guess[0]!=4) return;
                   break;
              case 1:
                   break;
              case 2:
                   if (guess[4]!=0) return;
                   break;
              case 3:
                   if (guess[0]==2) return;
                   break;
              case 4:
                   if (guess[0]!=3) return;
                   break;
       }
       if (guess[0]!=0 && guess[1]!=0 && guess[0]==4)
          return;
       if (guess[0]!=2 && guess[1]!=2 && guess[4]==0)
          return;
       if (guess[0]!=3 && guess[1]!=3 && guess[0]!=2)
          return;
       if (guess[0]!=4 && guess[1]!=4 && guess[0]==3)
          return;
       for (i=0;i<5;i++)
           place[guess[i]]=i+1;
       for (i=0;i<5;i++){
if (i)putchar(' ');
           printf("%d",place[i]);
}
       putchar('\n');
    }
    for (i=0;i<5;i++)
        if (!used[i]){
           used[i]=1;
           guess[lev]=i;
           find(lev+1);
           used[i]=0;
        }
}
int main()
{
    find(0);
    //while (2);
    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(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) continue;
		a=(E==1);
			b=(B==2);
			c=(A==5);
			d=(C!=1);
			e=(D==1);
		if((a+b+c+d+e==2)&&((A-a<2)+(B-b<2)+(C-c<2)+(D-d<2)+(E-e<2)==2)&&((A-a<1)+(B-b<1)+(C-c<1)+(D-d<1)+(E-e<1)==1)&&(E!=2)&&(E!=3))
			cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;

		}

		}

		}

		}
	return 0;
}
int main()
{
	int word[6]={0};
	for(int A = 1 ; A <=5 ; A++)
	{
		for(int B = 1 ; B <=5 ; B++)
		{
			if(A==B)continue;
			for(int C = 1 ; C <=5 ; C++)
			{
				if(C==B || C==A)continue;
				for(int D = 1 ; D <=5 ; D++)
				{
					if(D==A || D==B || D==C)continue;
					for(int E = 1 ; E <=5 ; E++)
					{
						if(E==A || E==B || E==C || E ==D || E==2 || E==3)continue;
						word[A]=(E==1);
						word[B]=(B==2);
						word[C]=(A==5);
						word[D]=(C!=1);
						word[E]=(D==1);
						if(word[1]==1 && word[2]==1 && word[3]==0 && word[4]==0 && word[5]==0)
						{
							cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int A,B,C,D,E,a,b,c,d,e;
	for(E=1;E<=5;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++)
				{
					if(A!=B&&A!=C&&A!=D&&A!=E&&B!=C&&B!=D&&B!=E&&C!=D&&C!=E&&D!=E&&E!=2&&E!=3)
					{
						a=0;b=0;c=0;d=0;e=0;
						if(E==1){a=1;}
						if(B==2){b=1;}
						if(A==5){c=1;}
						if(C!=1){d=1;}
						if(D==1){e=1;}
						if(a+b+c+d+e==2)
						{
							if(a==1&&(A==1||A==2))
							{
								if(b==1&&(B==1||B==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(c==1&&(C==1||C==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(d==1&&(D==1||D==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(e==1&&(E==1||E==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
							}
							if(b==1&&(B==1||B==2))
							{
								if(c==1&&(C==1||C==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(d==1&&(D==1||D==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(e==1&&(E==1||E==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
							}
							if(c==1&&(C==1||C==2))
							{
								if(d==1&&(D==1||D==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
								if(e==1&&(E==1||E==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
							}
							if(d==1&&(D==1||D==2))
							{
								if(e==1&&(E==1||E==2))
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
								}
							}
						}
					}
				}
			}
		}
	}
	}
	return 0;
}
int fa(int t);
int fb(int t);
int fc(int t);
int fd(int t);
int fe(int t);
int fa(int t){	if(t==1)	return 0;	else	return 1;}
int fb(int t){	if(t==2)	return 0;	else	return 1;}
int fc(int t){	if(t==5)	return 0;	else	return 1;}
int fd(int t){	if(t==1)	return 1;	else	return 0;}
int fe(int t){	if(t==1)	return 0;	else	return 1;}
void main()
{
	int a,b,c,d,e;//factory
	for(e=1;e<6;e++)
	{
		if(e==2||e==3)	continue;
		for(a=1;a<6;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==b||c==a||c==e)continue;
					d=15-a-b-c-e;
					if(a==1||a==2){	if(fa(e))	continue;}
					else		{if(0==fa(e))	continue;}
					if(b==1||b==2){	if(fb(b))	continue;}
					else		{if(0==fb(b))	continue;}
					if(c==1||c==2){	if(fc(a))	continue;}
					else		{if(0==fc(a))	continue;}
					if(d==1||d==2){	if(fd(c))	continue;}
					else		{if(0==fd(c))	continue;}
					if(e==1)	  {	if(fe(d))	continue;}
					else		{if(0==fe(d))	continue;}
					printf("%d %d %d %d %d",a,b,c,d,e);
					return;
				}
			}
		}
	}
}
//A 1 B 2 C 3 D 4 E 5
int main()
{
    int A,B,C,D,E; 
    for(A=1;A<=5;A++){
    for(B=1;B<=5;B++){
    if(B==A)  continue;
    for(C=1;C<=5;C++){
    if(C==A || C==B)  continue;
    for(D=1;D<=5;D++){
    if(D==A || D==B || D==C)  continue;
    for(E=1;E<=5;E++){
    if(E==A || E==B || E==C || E==D)  continue;
    if(E==2 || E==3)  continue;
    int a,b,c,d,e;
    a=(A==1)+(A==2)+(E==1);  
    b=(B==1)+(B==2)+(B==2);  
    c=(C==1)+(C==2)+(A==5);  
    d=(D==1)+(D==2)+(C!=1);  
    e=(E==1)+(E==2)+(D==1);
    if(a%2==0 && b%2==0 && c%2==0 && d%2==0 && e%2==0)
    {
    cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E;
    return 0;
    }
    }
    }
    }
    }
    }
    return 0;
}
int main ()
{
    int a,b,c,d,e,sum,a1,b1,c1,d1,e1,a2,b2,c2,d2,e2;
	for (a = 1; a <=5;a++)
		for (b = 1; b <= 5 ;b++)
		{
			if (a != b)
				for (c = 1; c <= 5; c++)
				{
					if (c != b && c != a)
						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)
									{
										a1 = (e == 1);
										b1 = (b == 2);
										c1 = (a == 5);
										d1 = (c != 1);
										e1 = (d == 1);
										if (a1 + b1 + c1 + d1 +e1 == 2)
										{a2= (a1 == 1 && (a == 1 || a == 2));
										 b2= (b1 == 1 && (b == 1 || b ==2));
										 c2= (c1 == 1 && (c == 1 || c == 2));
										d2 = (d1 == 1 && (d == 1 || d == 2));
										e2 =  (e1 == 1 && (e == 1));
												if (a2 + b2 +c2 +d2 +e2 ==2)		 cout << a <<" "<<b <<" "<<c <<" "<<d <<" " <<e;}
									}
								}
						}
				}
		}

	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!=a;b++)
		{
			for(c=1;c!=a&&c!=b&&c<=5;c++)
			{
				for(d=1;d<=5&&d!=a&&d!=b&&d!=c;d++)
				{
					for(e=1;e!=2&&e!=3&&e!=a&&e!=b&&e!=c&&e!=d;e++)
					{
						A=(e==1);
						B=1;
						C=(a==5);
                        D=(c!=1);
						E=(d==1);
						cout<<a<<" "<<d<<" "<<e<<" "<<c<<" "<<b;
					}
				}
			}
		}
	}
	cin.get();
	return 0;
}
//*******************
//*??:???      *
//*???????? *
//*???2013.11.8  *
//*******************
int main ()
{
	int a,b,c,d,e;
	for ( e = 1 ; e <= 35 ; e ++)
		if(e==1||e==4||e==5)                                                                      //????e???2?3
		for ( a = 1 ; a <= 5 ; a ++)
			if ( a!= e )
    			for (b = 1 ; b <= 5 ; b ++)
					if ( b!= e&& b != a )
	        			for ( c = 1 ; c <= 5 ; c ++)
							if ( c != e && c != a&& c != b )
		            			for ( d = 1 ;d<= 5 ; d ++)
									if ( d!=e && d != a && d!= b&& d != c)                         //???abcde????????????
										if ( ( (e== 1) + (b==2) + (a==5) + (c!=1) + (d==1) )== 2)
										{
											if ( a==1||a==2)                                      //?????????????????????????
											{
												if ( e!=1 )
													break;
											}
											else if (e==1)
												break ;
											if ( b==1||b==2 )                                     //?????????????????????????
											{
												if (b!=2)
													break ;
											}
											else if ( b==2)
												break;
											if ( c==1||c==2 )                                     //?????????????????????????
											{
												if (a!=5 )
													break ;
											}
											else if (a==5)
												break ;
											if  (d==1||d==2)                                     //?????????????????????????
											{
												if ( c==1 )
													break ;
											}
											else if ( c!=1)
												break;
											if (e==1||e==2)                                      //?????????????????????????
											{
												if(  d!=1 )
													break ;
											}
											else if ( d== 1)
												break ;
											cout <<a<< " " << b << " " << c<< " " << d << " "<<e <<endl ;          //?????

										}
	return 0 ;
}
int main()
{
	int A,B,C,D,E,a,b,c,d,e;
	for(E=1;E<=5;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++)
					{
						if( (A!=B)&&(A!=C)&&(A!=D)&&(A!=E)&&(B!=C)&&(B!=D)&&(B!=E)&&(C!=D)&&(C!=E)&&(D!=E)&&(E!=2)&&(E!=3))
						{
							a=(E==1);
							b=(B==2);
							c=(A==5);
							d=(C!=1);
							e=(D==1);
							if(((A+a<=3)+(B+b<=3)+(C+c<=3)+(D+d<=3)+(E+e<=3)==3)&&(a+b+c+d+e==2)&&((A+a<=2)+(B+b<=2)+(C+c<=2)+(D+d<=2)+(E+e<=2)==1)&&((A==a)+(B==b)+(C==c)+(D==d)+(E==e)==1))
							{cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;}
						}
					}
						return 0;
					}
/*
 * b.cpp
 *
 *  Created on: 2013-11-8
 *      Author: b
 */
int main(){
	int A,B,C,D,E;
	int g=0,sum=0;//sum?????????
	for(A=5;A<=5;A++){//?????
		for(B=2;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;//?????????
						sum=0;//sum?0

						if((A==1)||(A==2)&&(E==1)){//??A?1?2?????????
									 sum+=1;
								}
						if((B==1)||(B==2)&&(B==2)){//??B?1?2??????????
										sum+=1;
									}
						if((C==1)||(C==2)&&(A==5)){//??C?1?2??????????
											 sum+=1;
										}
						if((D==1)||(D==2)&&(C!=1)){//??D?1?2??????????
												 sum+=1;
											}
						if((E==1)||(E==2)&&(D==1)){//??E?1?2??????????
													 sum+=1;
												}
						if(sum==2){
							cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E<<endl;
							g=1;
							break;
						}
					}
					if(g==1) break;
				}
				if(g==1) break;
			}
			if(g==1) break;
		}
		if(g==1) break;
	}
	return 0;
}
int main()
{
	int a,b,c,d,e,i,j;
	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++)
					{
						j=0;
						for(i=1;i<6;i++)
						{
							if((a==i)+(b==i)+(c==i)+(d==i)+(e==i)>1)
								j=1;
						}
						if(e==2||e==3||j==1)
							continue;
						else  if((e==1)+(b==2)+(a==5)+(c>1)+(d==1)==2)
						{
							if((e==1)&&(b==2)&&((a==1)&(b==2)||(a==2)&&(b==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((e==1)&&(a==5)&&((a==1)&(c==2)||(a==2)&&(c==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((e==1)&&(c>1)&&((a==1)&(d==2)||(a==2)&&(d==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((e==1)&&(d==1)&&((a==1)&(e==2)||(a==2)&&(e==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((b==2)&&(a==5)&&((c==1)&(b==2)||(c==2)&&(b==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((b==2)&&(c>1)&&((d==1)&(b==2)||(d==2)&&(b==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((b==2)&&(d==1)&&((e==1)&(b==2)||(e==2)&&(b==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							else if((c>1)&&(a==5)&&((c==1)&(d==2)||(c==2)&&(d==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
								else if((d==1)&&(a==5)&&((c==1)&(e==2)||(c==2)&&(e==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
								else if((c>1)&&(d==1)&&((e==1)&(d==2)||(e==2)&&(d==1)))
							{
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
							return 0;}
							
						}
					}
}
int main()
{
	int A,B,C,D,E,s1,s2,s3,s4,s5,flag=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==B||C==A)continue;
				for(D=1;D<=5;D++)
				{
					if(D==C||D==B||D==A)continue;
					E=15-A-B-C-D;
					if(E!=2&&E!=3)
					{
						s1=(E==1);
						s2=(B==2);
						s3=(A==5);
						s4=(C!=1);
						s5=(D==1);
						if(s1+s2+s3+s4+s5==2)
						{
							if((A==1||A==2)&&s1==1&&s5==1&&D==1)
							{
								cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
								flag=1;
								break;								
							}
							if((B==1||B==2)&&s2==1)
							{
								if((C==1||C==2)&&s3==1)
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
									flag=1;
									break;
								}
							}
							if((C==1||C==2)&&s3==1)
							{
								if((D==1||D==2)&&s4==1)
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
									flag=1;
									break;
								}
								if((E==1||E==2)&&s5==1&&D==1)
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
									flag=1;
									break;
								}
							}
							if((D==1||D==2)&&s4==1)
							{
								if((E==1||E==2)&&s5==1)
								{
									cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
									flag=1;
									break;
								}
							}
						}
					}
				}
			if(flag==1)break;
			}
			if(flag==1)break;
		}
		if(flag==1)break;
	}
	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 != A && C != B)
					{
						for(D = 1; D <= 5;D ++)
						{
							if(D != A && D != B && D != C)
							{
								E = 15 - A - B - C - D;
								if(E != 2 && E != 3)
								{
									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 + b + c + d + e == 2)
										cout << A << " " << B << " " << C <<
										" "<< D << " " << E << endl;
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a=0,b=0,c=0,d=0,e=0;
    int i,j,k,t,l;
	for(i=1;i<=5;i++)
	{
		a=a+1;
		for(j=1;j<=5;j++)
		{
			b=b+1;
			for(k=1;k<=5;k++)
			{
				c=c+1;
				for(t=1;t<=5;t++)
				{
					d=d+1;
					for(l=1;l<=5;l++)
					{
						e=e+1;
						if(e!=4&&e!=3)
						{
							if(a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e)
							{
							if((e==5&&a==4)||(e!=5&&a!=5&&a!=4))
							{
								if((b==4)||(b!=4&&b!=5))
								{
									if((a==1&&c==5)||(a==1&&c==4)||(a!=1&&c!=4&&c!=5))
									{
										if((c!=5&&d==5)||(c!=5&&d==4)||(c==5&&d!=4&&d!=5))
										{
											if((d==5&&e==4)||(d!=5&&e!=5&&e!=4))
											{
												a=6-a;
												b=6-b;
												c=6-c;
												d=6-d;
												e=6-e;
												cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
												goto loop;
											}
										}
									}
								}
							}
						}
						}
					}
					e=0;
				}
				e=0;
				d=0;
			}
			e=0;
			d=0;
			c=0;
		}
		e=0;
		d=0;
		c=0;
		b=0;
	}
	loop:if(1+1==2)
	{
	}
	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;
                      }
}