semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int chang[5][2]={0},i,j,k,sum[2]={0};
	for (chang[0][0]=1;chang[0][0]<=5;chang[0][0]++)
	{
		if (chang[0][0]==5)
			chang[2][1]=1;
		else 
			chang[2][1]=0;
		for (chang[1][0]=1;chang[1][0]<=5;chang[1][0]++)
		{
			if (chang[1][0]==2)
				chang[1][1]=1;
			else 
				chang[1][1]=0;
			for (chang[2][0]=1;chang[2][0]<=5;chang[2][0]++)
			{
				if (chang[2][0]!=1)
					chang[3][1]=1;
				else
					chang[3][1]=0;
				for (chang[3][0]=1;chang[3][0]<=5;chang[3][0]++)
				{
					if (chang[3][0]==1)
						chang[4][1]=1;
					else
						chang[4][1]=0;
					for (chang[4][0]=1;chang[4][0]<=5;chang[4][0]++)
					{
						if (chang[4][0]==2 || chang[4][0]==3)
							continue;
						if (chang[4][0]==1)
							chang[0][1]=1;
						else
							chang[0][1]=0;
						sum[0]=0;sum[1]=0;
						for (i=0;i<5;i++)
						{
							sum[1]+=chang[i][1];
							sum[0]+=chang[i][0];
						}
						for (i=0;i<5;i++) 
						{
							for (j=0;j<5;j++)
							{
								if (chang[i][0]==1 && chang[j][0]==2 
									&& chang[i][1]*chang[j][1]==1 && sum[1]==2 && sum[0]==15 
									&&chang[1][0]!=chang[4][0]&&chang[1][0]!=chang[3][0])
								{
									for (k=0;k<4;k++)
									{cout <<chang[k][0]<<" ";}
									cout <<chang[4][0]<<endl;
								}
							}
						}
					}
				}
			}
		}
	}return 0;
}
int main()
{
	int A,B,C,D,E;
	for(A=1;A<=5;A++)
	{
		B=1;
		for(B=1;B<=5;B++)
		{
			C=1;
			if(A==B)continue;
			for(C=1;C<=5;C++)
			{
				D=1;
				if(A==C||B==C)continue;
				for(D=1;D<=5;D++)
				{
					E=1;
					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;
						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))))
						{
							cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;
							return 0;
						}
					}
				}
			}

		}
	}
	return 0;
}
int main()
{
  int n[6],m[6],sum=0,i=0;
  for(n[5]=1;n[5]<=5;n[5]++)
  {
	  if(n[5]==2||n[5]==3)
		  continue;
	  for(n[2]=1;n[2]<=5;n[2]++)
	  {
		  if(n[2]==n[5])
			  continue;
		  for(n[1]=1;n[1]<=5;n[1]++)
		  {
			  if(n[1]==n[2]||n[1]==n[5])
				  continue;
			  for(n[3]=1;n[3]<=5;n[3]++)
			  {
				  if(n[1]==n[3]||n[2]==n[3]||n[5]==n[3])
					  continue;
				  n[4]=15-n[1]-n[2]-n[3]-n[5];
				  m[1]=(n[5]==1);
				  m[2]=(n[2]==2);
				  m[3]=(n[1]==5);
				  m[4]=(n[3]!=1);
				  m[5]=(n[4]==1);
				  sum=0;
				  for(i=1;i<=5;i++)
				  {
					  if(m[i]==1)
					  {  if(n[i]==1||n[i]==2)
							  sum++;
					  }
					  else
					  {
						  if(n[i]==3||n[i]==4||n[i]==5)
							  sum++;
					  }
				  }
				  if(sum==5)
					  cout<<n[1]<<" "<<n[2]<<" "<<n[3]<<" "<<n[4]<<" "<<n[5]<<endl;
			  }
		  }
	  }
  }
  

	 return 0;
}
int main()
{
	int a,b,c,d,e;
	int a1,b1,c1,d1,e1;
	e = 1;
	for(int a = 1; a<= 5; a++)
	{
		for( b = 1; b <= 5 ;b++)
		{
			a1 = 5;
			if( b == 2 && ( b!= 1 || b != 2))
				continue;
			     b1 =2;
			for( c = 1; c <= 5; c++)
			{
				if( a == 5 && ( c!=1 ||c != 2))
					continue;
				    c1 = 1;
				for(d =1; d<= 5; d++)
				{
					if( c!=1 && ( d != 1 || d != 2))
						continue;
				       d1 =3; e1 =4;
					for( e =1 ;e<= 5;e++)
					{
						if( e == 2 || e == 3)
							continue;
						if ( a1!=b1 && a1!=c1 &&a1!=d1 &&a1!=e1 &&b1 !=c1 &&b1!= d1&& b1!= e1 &&c1!= d1 &&c1!=e1 &&d1 !=e1)
						{
						    cout << a1 <<" " << b1 <<" " <<c1 <<" " << d1 << " " <<e1 << endl;
							return 0;
						  
						}
					}
					e = 1;
				}
				d = 1;
			}
			c = 1;
		}
		d=1;
	}
	return 0;
}
int main()
{   int a,b,c,d,e;
    int rank[6]={0,0,0,0,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(a==b||a==c||a==d||a==e||b==c||b==d||b==e||c==d||c==e||d==e)   continue;
                       if(e==2||e==3)  continue;
                         rank[a]=(e==1);
                         rank[b]=(b==2);
                         rank[c]=(a==5);
                         rank[d]=(c!=1);
                         rank[e]=(d==1);
                         if(rank[1]==1&&rank[2]==1&&rank[3]==0&&rank[4]==0&&rank[5]==0)
                         {cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
                         }
                     }
                         
                         
    return 0;
}
int main()
{
	int a,b,c,d,e,w[6];
	for(e=1;e<6;e++)
	{
		if(e==2||e==3)
			continue;
		for(d=1;d<6;d++)
		{
			if(d==e)
				continue;
			for(c=1;c<6;c++)
			{
				if(c==d||c==e)
					continue;
				for(b=1;b<6;b++)
				{
					if(b==c||b==d||b==e)
						continue;
					a=15-e-d-c-b;
					w[1]=((a==1||a==2)&&e==1)||(e!=1&&a>2);
					w[2]=(b>1);
					w[3]=((c==1||c==2)&&a==5)||(c>2&&a<5);
					w[4]=((d==1||d==2)&&c>1)||(d>2&&c==1);
					w[5]=(e>3&&d>1);
					if(w[1]+w[2]+w[3]+w[4]+w[5]==5)
					{
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int A[5];
	int a[5];
	int flag = 0;
	int count = 0;

	for(a[0] = 5; a[0] >0;a[0]--)
	{
		if(flag == 1)break;
		for(a[1] = 1; a[1] < 6;a[1]++)
		{
			if(flag == 1)break;
			if(a[1] == a[0])continue;
			for(a[2] = 1; a[2] < 6;a[2]++)
			{
				if(flag == 1)break;
				if(a[2] == a[1]||a[2]==a[0])continue;
				for(a[3] = 1; a[3] < 6;a[3]++)
				{
					if(flag == 1)break;
					if(a[3] == a[2]||a[3]==a[1]||a[3]==a[0])continue;
					for(a[4] = 1; a[4] < 6;a[4]++)
					{
						if(flag == 1)break;
						if(a[4] == a[1]||a[4]==a[2]||a[4]==a[0]||a[4]==a[3])continue;
						if(a[4]==2||a[4]==3)continue;
						A[0] = (a[4] == 1);
						A[1] = (a[1] == 2);
						A[2] = (a[0] == 5);
						A[3] = (a[2] != 1);
						A[4] = (a[3] == 1);
						count = 0;
						for(int i = 0; i<5;i++)
						{
							if(a[i] < 3 && A[i] == 1)
								count ++;
						}
						if(count == 2)
						{
							cout<<a[0] <<" "<<a[1] <<" "<<a[2] <<" "<<a[3] <<" "<<a[4] <<endl;
							flag = 1;
						}

					}
				}
			}
		}
	}
	return 0;
}
int main()
{
    int c[100],i,j = 0,sum = 0,q = 0,k1,k2,b[10];
	for (c[5] = 1; c[5]<=5;c[5]++ )
	{
		if (c[5] == 2 || c[5] == 3)
			continue;
		for (c[1] = 3; c[1]<= 5; c[1]++)
		{
			if(c[1] == c[5])
				continue;
			for (c[2] = 1; c[2]<= 5; c[2]++)
			{
				if(c[1] == c[2] || c[2] == c[5])
				continue;
				for (c[3] = 1; c[3]<= 5; c[3]++)
				{
					if(c[3] == c[2] || c[3] == c[5] || c[3] == c[1])
				         continue;
					for (c[4] = 1; c[4]<= 5; c[4]++)
					{
						if(c[4] == c[2] || c[4] == c[5] || c[4] == c[1] || c[4] == c[3])
				            continue;
						for (i = 1; i <= 5; i++)
						{
							if (c[i] == 1)
								k1 = i;
							if (c[i] == 2)
								k2 = i;
						}
						b[1] = (c[5] == 1);
						b[2] = (c[2] == 2);
						b[3] = (c[1] == 5);
						b[4] = (c[3] != 1);
						b[5] = (c[4] == 1);
						if (b[k1] == 1 && b[k2] == 1)
						{
							sum = 0;
							for (i = 1; i <= 5; i++)
							{
								sum = sum + b[i];
							}
							if (sum == 2)
							{
								q = 1;
							}
						}
						if (q == 1)
							break;
					}
					if (q == 1)
							break;
				}
				if (q == 1)
							break;
			}
			if (q == 1)
							break;
		}
		if (q == 1)
							break;
	}
	cout << c[1];
	for (i = 2; i <= 5; i++)
		cout << " " << c[i];
	return 0;
}
int main()
{
	int a[5],i,j,k;
	for(a[0]=1;a[0]<6;a[0]++)
		for(a[1]=1;a[1]<6;a[1]++)
		{
			if(a[1]==a[0])
				continue;
			else
			{
				for(a[2]=1;a[2]<6;a[2]++)
				{
					if(a[2]==a[0]||a[2]==a[1])
						continue;
					else
					{
						for(a[3]=1;a[3]<6;a[3]++)
						{
							if(a[3]==a[0]||a[3]==a[1]||a[3]==a[2])
								continue;
							else
							{
								a[4]=15-a[0]-a[1]-a[2]-a[3];
								
								int w[5];
								w[0]=(a[4]==1);
								w[1]=(a[1]==2);
								w[2]=(a[0]==5);
								w[3]=(a[2]!=1);
								w[4]=(a[3]==1);
								for(k=0;k<4;k++)
									for(j=k+1;j<5;j++)
									{
										if(a[4]!=2&&a[4]!=3&&(w[j]+w[k]==2)&&((a[j]==1&&a[k]==2)||(a[j]==2&&a[k]==1))&&w[0]+w[1]+w[2]+w[3]+w[4]==2)
										{
											for(i=0;i<4;i++)
												cout<<a[i]<<" ";
										    cout<<a[4]<<endl;
										}
									}


							}
						}
					}
				}
			}
		}
		return 0;

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

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


	return 0;
}
main()
{
  int i;
  int a[5]={5,2,1,3,4};
  for(i=0;i<4;i++)
  {
    printf("%d ",a[i]);
  }
  printf("%d",a[i]);
}
int main()
{
	int r[5],i,j;
	int t[5];
	int flag=0;

	for (r[0]=5;r[0]>0;r[0]--)
		for (r[1]=5;r[1]>0;r[1]--)
			for (r[2]=5;r[2]>0;r[2]--)
				for (r[3]=5;r[3]>0;r[3]--)
					for (r[4]=5;r[4]>0;r[4]--)
					{
						if (r[4]!=2 && r[4]!=3 && (r[0]-r[1]) * (r[0]-r[2]) * (r[0]-r[3]) * (r[0]-r[4]) * (r[1]-r[2]) * (r[1]-r[3]) * (r[1]-r[4]) * (r[2]-r[3]) *(r[2]-r[4]) *(r[3]-r[4]) !=0 )
						{
								t[0]=(r[4]==1);
								t[1]=(r[1]==2);
								t[2]=(r[0]==5);
								t[3]=(r[2]!=1);
								t[4]=(r[3]==1);
								if (t[0]+t[1]+t[2]+t[3]+t[4]==2 )
								{
									for (i=0;i<5;i++)
										if (t[i]==1 && (r[i]-1) *(r[i]-2)==0 )
											flag++; 
									if (flag==2)
									{	
										for (j=0;j<4;j++)
											cout<<r[j]<<' ';
										cout<<r[4];
									}
									else continue;
								}
								else continue;
						}
						else continue;
					}
	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))
					for (e=1;e<=5;e++) if ((a!=e)&&(b!=e)&&(c!=e)&&(d!=e)&&(e!=2)&&(e!=3))
					{
						if ((a+b==3)&&(e==1)&&(b==2) &&(a!=5)&&(c==1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((a+c==3)&&(e==1)&&(b!=2) &&(a==5)&&(c==1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((a+d==3)&&(e==1)&&(b!=2) &&(a!=5)&&(c!=1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((a+e==3)&&(e==1)&&(b!=2) &&(a!=5)&&(c==1)&&(d==1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((b+c==3)&&(e!=1)&&(b==2) &&(a==5)&&(c==1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((b+d==3)&&(e!=1)&&(b==2) &&(a!=5)&&(c!=1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((b+e==3)&&(e!=1)&&(b==2) &&(a!=5)&&(c==1)&&(d==1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((c+d==3)&&(e!=1)&&(b!=2) &&(a==5)&&(c!=1)&&(d!=1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((c+e==3)&&(e!=1)&&(b!=2) &&(a==5)&&(c==1)&&(d==1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						if ((d+e==3)&&(e!=1)&&(b!=2) &&(a!=5)&&(c!=1)&&(d==1))
							cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
					}
}
int main()
{   
	int A,B,C,D,E,senA,senB,senC,senD,senE;


	for (A=1;A<=5;A++){
		for (B=1;B<=5;B++){

       if(B==A)continue;
	    for (C=1;C<=5;C++){
		   if(C==B||C==A)continue;
		   for (D=1;D<=5;D++){
			    if(D==A||D==B||D==C)continue;
				for (E=1;E<=5;E++){
					 {
					 	if(E==A||E==B||E==C||E==D||E==2||E==3)continue;
						senA=(E==1);
						senB=(B==2);
						senC=(A==5);
						senD=(C!=1);
						senE=(D==1);

						if(   (A*senA+B*senB+C*senC+D*senD+E*senE)==3&& (A+B+C+D+E+senA+senB+senC+senD+senE)==17  )
							
							cout << A <<" "<< B <<" "<< C <<" "<< D <<" "<< E <<endl;
					 }
	}}}	} }
					
						
                       


					 
			 
		
	


return 0;
}
int main()
{
	int a,b,c,d,e,ta,tb,tc,td,te;
	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)
					{
						ta=(e==1);
						tb=(b==2);
						tc=(a==5);
						td=(c!=1);
						te=(d==1);
						if (ta+tb+tc+td+te==2)
						{
							if (a+b==3&&ta+tb==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e; 
							if (a+c==3&&ta+tc==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (a+d==3&&ta+td==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (a+e==3&&ta+te==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (b+c==3&&tb+tc==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (b+d==3&&tb+td==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (b+e==3&&tb+te==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (c+d==3&&tc+td==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (c+e==3&&tc+te==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							if (d+e==3&&td+te==2) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
						}
					}
				
				
				
				}
						
			
			}
		
		}
			

	return 0;
}