semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a,b,c,d,e,as[5]={0},i,j;
	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++)
					{
						as[0]=(e==1);
						as[1]=(b==2);
						as[2]=(a==5);
						as[3]=(c!=1);
						as[4]=(d==1);
						
						if(as[0]+as[1]+as[2]+as[3]+as[4]==2)
						{
							if(a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=d&&b!=e&&c!=d&&c!=e&&d!=e&&e!=2&&e!=3)
							{
								if(as[0]==1&&a!=1&&a!=2) continue;
								else if(as[1]==1&&b!=1&&b!=2) continue;
								else if(as[2]==1&&c!=1&&c!=2) continue;
								else if(as[3]==1&&d!=1&&d!=2) continue;
								else if(as[4]==1&&e!=1&&e!=2) continue;
								else cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
								}
							}
						}
					
		
		return 0;			
}
int main()
{
	int  m[6] = {0},a[6] = {0}, i, j;
    for (m[1] = 2; m[1] <= 5; m[1]++)
	{
		for (m[2] = 1; m[2] <= 5; m[2]++)
		{
			if(m[2] == m[1]) 
		       continue;
			for (m[3] = 1; m[3] <= 5; m[3]++)
			{
				if((m[3]==m[2])||(m[3] == m[1]))
			        continue;
				for (m[4] = 1; m[4] <= 5; m[4]++)
				{
					if((m[4]==m[3])||(m[4] == m[2])||(m[4]==m[1]))
			           continue;
			        m[5] = 15-m[4]-m[3]-m[2]-m[1];
					if((m[5]==m[1])||(m[5]==m[2])||(m[5]==m[3])||(m[5]==m[4]))
						continue;
					if ((m[5] == 2)||(m[5] == 3)||(m[5] ==1))
						continue;
					a[1]=(m[5]==1);
					a[2]=(m[2]==2);
					a[3]=(m[1]==5);
					a[4]=(m[3]!= 1);
					a[5]=(m[4]==1);
			        if((m[5]==1)+(m[2]==2)+(m[1]==5)+(m[3]!= 1)+(m[4]==1) ==2)
					{
						for(i =1;i <=5;i++)
						{
							if((m[i]==1)&&(a[i]==1))
								for(j = 1;j<=5;j++)
								{
									if((m[j]==2)&&(a[j]==1))
										cout << m[1] <<" "<< m[2] <<" "<< m[3] <<" " << m[4] <<" " << m[5];
								}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int A,B,C,D,E,i,word[6],c1;
	char rank[6];
	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;
					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);
					c1=(E!=2&&E!=3);
					if(word[1]==1&&word[2]==1&&c1==1&&word[3]==0&&word[4]==0&&word[5]==0)
					 cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;
				}
			}
		}
	}
	return 0;
}
int main()
{
	int a[5],b[5];
	int 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]++)
					{
						if (a[0] == a[1] ||a[0] == a[2] ||a[0] == a[3] ||a[0] == a[4] ||a[2] == a[1] ||a[3] == a[1]
						||a[4] == a[1] ||a[2] == a[3] ||a[2] == a[4] || a[3] == a[4] || 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 (i = 0; i < 5;i ++)
						{
							if (a[i] == 1)
							{
								j = i;
							}
							if (a[i] == 2)
							{
								k = i;
							}
						}
						if ( b[j] == 1 && b[k] == 1 && ((b[0] + b[1] + b[2] + b[3] + b[4]) == 2))
						{
							cout << a[0] << " " << a[1] << " " << a[2] << " " << a[3] << " " << a[4];
						}
					}
				}
			}
		}
	}
	return 0;
}
void pan(int r[5])
{
	int p[5],t[5],i;
	p[0]=(r[0]==4);
	p[1]=(r[1]==1);
	p[2]=(r[4]==0);
	p[3]=(r[0]!=2);
	p[4]=(r[0]==3);
	if(p[r[0]]==1&&p[r[1]]==1&&p[r[2]]==0&&p[r[3]]==0&&p[r[4]]==0&&r[1]!=4&&r[2]!=4)
	{
		for(i=0;i<5;i++)
		t[r[i]]=i+1;
		printf("%d",t[0]);
		for(i=1;i<5;i++)
		printf(" %d",t[i]);
	}
}
int main()
{
	int r[5];
	for(r[0]=0;r[0]<5;r[0]++)
	for(r[1]=0;r[1]<5;r[1]++)
	if(r[1]==r[0]) continue;
	else
	for(r[2]=0;r[2]<5;r[2]++)
	if(r[2]==r[1]||r[2]==r[0]) continue;
	else
	for(r[3]=0;r[3]<5;r[3]++)
	{
	if(r[3]==r[2]||r[3]==r[1]||r[3]==r[0]) continue;
	else
	r[4]=10-r[0]-r[1]-r[2]-r[3];
	pan(r);
}
}
int a=0,b=0,c=0,d=0,e=0;
void one(char x)
{
	char y;
	switch(x)
	{
	case 'A':y='0';break;
	case 'B':y='0';break;
	case 'C':a=5;c=1;y='C';break;
	case 'D':if(c!=1)
			 {
				 d=1;
				 y='D';
			 }
			 else
			 {
				 y='0';
			 }
			 break;
	case 'E':y='0';break;
	}
	if(y=='0')
	{
		one(x+1);
	}
}
void two(char x)
{
	char y;
	switch(x)
	{
	case 'A':if(a==1||e!=1)
			 {
				 y='0';
			 }
			 else
			 {
				 a=2;
				 y='A';
			 }
			 break;
	case 'B':if(b==1)
			 {
				 y='0';
			 }
			 else
			 {
				 b=2;
				 y='B';
			 }
			 break;
	case 'C':if(c==1)
			 {
				 y='0';
			 }
			 else
			 {
				 c=2;
				 a=5;
				 y='C';
			 }
			 break;
	case 'D':if(c==1||d==1)
			 {
				 y='0';
			 }
			 else
			 {
				 d=2;
				 y='D';
			 }
			 break;
	case 'E':y='0';break;
	}
	if(y=='0')
	{
		two(x+1);
	}
}
void three(char x)
{
	char y;
	switch(x)
	{
	case 'A':if(a==1||a==2||c==1||c==2||e==1)
			 {
				 y='0';
			 }
			 else
			 {
				 a=3;
				 y='A';
			 }
			 break;
	case 'B':if(b==1||b==2)
			 {
				 y='0';
			 }
		else
		{
			b=3;
			y='B';
		}
		break;
	case 'C':if(c==1||c==2||a==5||(d!=1&&d!=2))
			 {
				 y='0';
			 }
		else
		{
			c=3;
			y='C';
		}
		break;
	case 'D':if(d==1||d==2||e==1||e==2||c!=1)
			 {
				 y='0';
			 }
		else
		{
			d=3;
			y='D';
		}
		break;
	case 'E':y='0';break;
	}
	if(y=='0')
	{
		three(x+1);
	}
}
void four(char x)
{
	char y;
	switch(x)
	{
	case 'A':if(a==1||a==2||a==3||c==1||c==2||e==1)
			 {
				 y='0';
			 }
		else
		{
			a=4;
			y='A';
		}
		break;
	case 'B':if(b==1||b==2||b==3)
			 {
				 y='0';
			 }
		else
		{
			b=4;
			y='B';
		}
		break;
	case 'C':if(c==1||c==2||c==3||(d!=1&&d!=2))
			 {
				 y='0';
			 }
		else
		{
			c=4;
			y='C';
		}
		break;
	case 'D':if(d==1||d==2||d==3||e==1||e==2||c!=1)
			 {
				 y='0';
			 }
		else
		{
			d=4;
			y='D';
		}
		break;
	case 'E':if(e==1||e==2||e==3||d==1)
			 {
				 y='0';
			 }
		else
		{
			e=4;
			y='E';
		}
		break;
	}
	if(y=='0')
	{
		four(x+1);
	}
}
void five(char x)
{
	char y;
	switch(x)
	{
	case 'A':if(a==1||a==2||a==3||a==4||(c!=1&&c!=2)||e==1)
			 {
				 y='0';
			 }
		else
		{
			a=5;
			y='A';
		}
		break;
	case 'B':if(b==1||b==2||b==3||b==4)
			 {
				 y='0';
			 }
		else
		{
			b=5;
			y='B';
		}
		break;
	case 'C':if(c==1||c==2||c==3||c==4||(d!=1&&d!=2))
			 {
				 y='0';
			 }
		else
		{
			c=5;
			y='C';
		}
		break;
	case 'D':if(d==1||d==2||d==3||d==4||e==1||e==2||c!=1)
			 {
				 y='0';
			 }
		else
		{
			d=5;
			y='D';
		}
		break;
	case 'E':if(e==1||e==2||e==3||e==4||d==1)
			 {
				 y='0';
			 }
		else
		{
			e=5;
			y='E';
		}
		break;
	}
	if(y=='0')
	{
		five(x+1);
	}
}
int main()
{
	void one(char x);
	void two(char x);
	void three(char x);
	void four(char x);
	void five(char x);
	char now='A';
	one(now);
	two(now);
	three(now);
	four(now);
	five(now);
	printf("%d %d %d %d %d\n",a,b,c,d,e);
	return 0;
}
int main()
{
	int a=0,b=0,c=0,d=0,e=0,A=0,B=0,C=0,D=0,E=0;
	for(a=1;a<6;a++)
		for(b=1;b<6;b++)
			for(c=1;c<6;c++)
				for(d=1;d<6;d++)
					for(e=1;e<6;e++)
					{
						if(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))
								if((a==1&&b==2)+(a==2&&b==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							    if((A==1)&&(B==0)&&(C==1)&&(D==0)&&(E==0))
								if((a==1&&c==2)+(a==2&&c==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							    if((A==1)&&(B==0)&&(C==0)&&(D==1)&&(E==0))
								if((a==1&&d==2)+(a==2&&d==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							    if((A==1)&&(B==0)&&(C==0)&&(D==0)&&(E==1))
								if((a==1&&e==2)+(a==2&&e==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
							    if((A==0)&&(B==1)&&(C==1)&&(D==0)&&(E==0))
								if((c==1&&b==2)+(c==2&&b==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
								if((A==0)&&(B==1)&&(C==0)&&(D==1)&&(E==0))
								if((d==1&&b==2)+(d==2&&b==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
								if((A==0)&&(B==1)&&(C==0)&&(D==0)&&(E==1))
								if((e==1&&b==2)+(e==2&&b==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
								if((A==0)&&(B==0)&&(C==1)&&(D==1)&&(E==0))
								if((c==1&&d==2)+(c==2&&d==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
								if((A==0)&&(B==0)&&(C==1)&&(D==0)&&(E==1))
								if((c==1&&e==2)+(c==2&&e==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
								if((A==0)&&(B==0)&&(C==0)&&(D==1)&&(E==1))
								if((d==1&&e==2)+(d==2&&e==1)==1)
									cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;							}
					}
	return 0;
}
int main ()
{
	int A , B , C , D , E , i , j , k , l , m ;
	for ( i = 1 ; i <= 5 ; i++ )
	{
		A = i ;
		for ( j = 1 ; j <= 5 ; j++ )
		{
			if (j == i) continue ;
			else B = j ;
			for ( k = 1 ; k <= 5; k ++ )
			{
				if ( ( k == i ) || ( k == j ) ) continue ;
				else C = k ;
				for ( l = 1 ; l <= 5 ; l++ )
				{
					if ( ( l == i ) || ( l == j ) || ( l == k ) ) continue ;
					else D = l ;
					for ( m = 1 ; m <= 5 ; m++ )
					{
						if ( ( m == i ) || ( m == j ) || ( m == k ) || ( m == l ) ) continue ;
						else E = m ;
						if ((((A == 2) && (E == 1)) + (B == 2) + (((C == 1) || (C == 2)) && (A == 5)) + (((E == 1)||(E == 2)) && (D == 1) )== 2 ) && (E != 2) && (E != 3))
							cout << A <<' ' << B << ' ' << C << ' ' << D << ' ' << E << endl;
					}
				}
			}
		}
	}
	return 0 ;
}
int a[5];
int j;
void f(int m)
{
   for(int i=1;i<6;i++) 
   {
        if(m==0) 
        {
             a[m]=i;
             f(m+1);
        }
        else
        {
             for(j=0;j<m;j++)
             {
             if(i==a[j]) break;
             }
             if (j==m) 
             {
             a[m]=i;
             if (m!=4) f(m+1); 
             else 
             {
                 if((((a[0]==1||a[0]==2)&&(a[4]==1))||((a[0]==3||a[0]==4||a[0]==5)&&a[4]!=1))&&(a[4]!=2&&a[4]!=3)&&(a[1]==2)&&(((a[2]==1||a[2]==2)&&(a[0]==5))||((a[2]==3||a[2]==4||a[2]==5)&&a[4]!=5))&&(((a[3]==1||a[3]==2)&&(a[2]!=1))||((a[3]==3||a[3]==4||a[3]==5)&&a[2]==1))&&(((a[4]==1||a[4]==2)&&(a[3]==1))||((a[4]==3||a[4]==4||a[4]==5)&&a[3]!=1)))
                 for(int y=0;y<5;y++) 
                 {
                      printf("%d",a[y]);
                      if(y!=4) printf(" ");
                      else printf("\n");
                 }
             }
             }
             
        }
   }
}
main()
{
     void f(int a);
     f(0); 
}
/*
 * air.cpp
 *
 *  Created on: 2012-11-10
 *      Author: ada
 */
int main()
{
	int a , b , c ,d , e ,words[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 == c || d == b || d == a)
						continue;
					for(e = 1 ; e<= 5 ; e++)
					{
						if(e == a || e == b || e == c || e == d)
							continue;
						words[a] = (e == 1);
						words[b] = (b == 2);
	                    words[c] = (a == 5);
	                    words[d] = (c != 1);
	                    words[e] = (d == 1);
						if(words[1]+words[2] == 2 && words[3]+words[4]+words[5] == 0 &&( e!=2)&&(e!=3))
						{
							cout <<a <<" " << b <<" " << c<<" " <<d <<" "<< e;
						}
					}
				}
			}
		}
	}
}
int main (  )
{
  int mingci[6];
  int a,b,c,d,e;
  int a1,a2,a3,a4,a5,zong;
  for(a=1;a<=5;a++)
  {
	  for(b=1;b<=5;b++)
	  {
		  if(a==b)continue;
		  else for(c=1;c<=5;c++)
		  {
			  if(a==c||b==c)continue;
			  else for(d=1;d<=5;d++)
			  {
				  if(a==d||b==d||c==d)continue;
				  else e=15-a-b-c-d;
				  if((e==1)&&(d==1)&&(a!=1)&&(a!=2)&&(c!=1)&&(a!=5))
				  {
				   mingci[a]=a;
				   mingci[b]=b;
				   mingci[c]=c;
				   mingci[d]=d;
                   mingci[e]=e;
				   cout<<15-mingci[b]-mingci[c]-mingci[d]-mingci[e]<<" "<<mingci[b]<<" "<<mingci[c]<<" "<<mingci[d]<<" "<<mingci[e]<<endl;
				  }
				  else if((e!=2)&&(e!=3)&&(d!=1))
				  {
					  if((d==2)&&(c!=1))
					  {
                       a1=((a==1)&&(e==1)&&(b!=2)&&(a!=5));
				       a2=((b==1)&&(b==2)&&(e!=1)&&(a!=5));
				       zong=a1+a2;
					   if(zong==1){mingci[a]=a;
				       mingci[b]=b;
				       mingci[c]=c;
				       mingci[d]=d;
                       mingci[e]=e;
					   cout<<15-mingci[b]-mingci[c]-mingci[d]-mingci[e]<<" "<<mingci[b]<<" "<<mingci[c]<<" "<<mingci[d]<<" "<<mingci[e]<<endl;}
					  }
					  if((d!=2)&&(c==1)&&(a==5))
					  {
				        a2=((b==2)&&(b==2)&&(e!=1));
						if(a2==1)mingci[a]=a;
				       mingci[b]=b;
				       mingci[c]=c;
				       mingci[d]=d;
                       mingci[e]=e;
                       cout<<mingci[a]<<" "<<mingci[b]<<" "<<mingci[c]<<" "<<mingci[d]<<" "<<mingci[e]<<endl;
					  }
				  }
			  }
		  }
	  }
  }
	return 0;
}
/*
 * test.cpp
 *
 *  Created on: 2011-11-6
 *      Author: b
 */

int main()
{
	int a,b,c,d,e;//?????????ABCDE???
	int p[6]={0,1,1,0,0,0};//?????????1-5??????
	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==1&&p[a]==1)||(e!=1&&p[a]==0))//A????????
								&&((b==2)||(b!=2&&p[b]==0))//B????????
								&&((a==5&&p[c]==1)||(a!=5&&p[c]==0))//C????????
								&&((c!=1&&p[d]==1)||(c==1&&p[d]==0))//D????????
								&&((d==1&&e==2)||(d!=1&&p[e]==0))//E????????
								&&(e!=2&&e!=3))//E????????
						{
							cout<<a<<' ';//????
							cout<<b<<' ';
							cout<<c<<' ';
							cout<<d<<' ';
							cout<<e;
							a=b=c=d=e=6;
						}
					}
				}
			}
		}
	return 0;
}
int main()
{
	int A,B,C,D,E,AS,CS,DS,ES;
	for(A=1;A<=5;A++)
	{
		for(B=1;B<=2;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;
						AS=(E==1);
						CS=(A==5);
						DS=(C!=1);
						ES=(D==1);
						if((B==1&&A==2&&AS==1&&CS==0&&DS==0&&ES==0)||(B==1&&C==2&&CS==1&&AS==0&&DS==0&&ES==0)||(B==1&&D==2&&DS==1&&CS==0&&DS==0&&ES==0)||(B==2&&A==1&&AS==1&&CS==0&&DS==0&&ES==0)||(B==2&&C==1&&CS==1&&AS==0&&DS==0&&ES==0)||(B==2&&D==1&&DS==1&&CS==0&&AS==0&&ES==0)||(B==2&&E==1&&ES==1&&CS==0&&DS==0&&AS==0))
							cout << A << " " << B << " " << C << " " << D << " " << E << endl;

					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int g[6],i,j,k,num[6];
	for(g[1]=1;g[1]<6;g[1]++)
		for(g[2]=1;g[2]<6;g[2]++)
			if(g[1]!=g[2])
				for(g[3]=1;g[3]<6;g[3]++)
					if(g[3]!=g[1]&&g[3]!=g[2])
						for(g[4]=1;g[4]<6;g[4]++)
							if(g[4]!=g[1]&&g[4]!=g[2]&&g[4]!=g[3]){
								g[5]=15-g[1]-g[2]-g[3]-g[4];
								if(g[5]!=2&&g[5]!=3){
									num[1]=(g[5]==1);
									num[2]=(g[2]==2);
									num[3]=(g[1]==5);
									num[4]=(g[3]!=1);
									num[5]=(g[4]==1);
									j=0;
									for(k=1;k<6;k++)
									{
										if(g[k]==1||g[k]==2)
										{if(num[k]==1)
										j++;}
										else
										{if(num[k]==0)
										j++;}}
                                     if(j==5)
									 {for(i=1;i<5;i++)
											 cout<<g[i]<<' ';
									 cout<<g[5];
									 return 0;}}}
	return 0;
}
int main()
{

	
	
	int n;
	
	int com[6];
	int say[6];
	int fir,sec;

	int i,judge;
	for(com[1]=1;com[1]<=5;com[1]++)
	{
		if(com[1]==1)
		{
			fir=1;
		}
		if(com[1]==2)
		{
			sec=1;
		}
		for(com[2]=1;com[2]<=5 ;com[2]++)
	{
		if(com[2]==com[1])
			continue;
		if(com[2]==1)
		{
			fir=2;
		}
		if(com[2]==2)
		{
			sec=2;
		}

		for(com[3]=1;com[3]<=5 ;com[3]++)
	{
		if(com[3]==com[1] || com[3]==com[2])
			continue;
		if(com[3]==1)
		{
			fir=3;
		}
		if(com[3]==2)
		{
			sec=3;
		}
		for(com[4]=1;com[4]<=5 ;com[4]++)
	{
		if(com[4]==com[1] || com[4]==com[2] || com[4]==com[3])
			continue;
		if(com[4]==1)
		{
			fir=4;
		}
		if(com[4]==2)
		{
			sec=4;
		}
		com[5]=15-com[1]-com[2]-com[3]-com[4];
		if(com[5]==com[1] || com[5]==com[2] || com[5]==com[3] ||  com[5]==com[4])
		{
			continue;
		}
		if(com[5]==1)
		{
			fir=5;
		}
		if(com[5]==2)
		{
			sec=5;
		}
		say[1]=(com[5]==1);
		say[2]=(com[2]==2);
		say[3]=(com[1]==5);
		say[4]=(com[3]!=1);
		say[5]=(com[4]==1);


		judge=(com[5]==1)+(com[2]==2)+(com[1]==5)+(com[3]!=1)+(com[4]==1);
		if(judge==2 && say[fir]==1 && say[sec]==1 && com[5]!=2 && com[5]!=3)
		{
			for(i=1;i<=4;i++)
			{
				cout<<com[i]<<" ";
			}
			cout<<com[5];

		
		}
		}
		}
		}
	}

	

	
	
    



	
	
			












return 0;
}
int main ()
{
	int a,b,c,d,e;

	for (a=1;a<6;a++)
		for (b=1;b<6;b++)
			for (c=1;c<6;c++)
				for (d=1;d<6;d++)
					for (e=1;e<6;e++)
					{
						if (a==b||a==c||a==d||a==e||b==c||b==d||b==e||c==d||c==e||d==e||e==2||e==3)
							continue;
						else
						{
							if (a==1||a==2){
								if (e!=1)
									continue;}
							if (a==3||a==4||a==5){
								if (e==1)
									continue;}
							if (b==1||b==2){
								if (b!=2)
									continue;}
							if (b==3||b==4||b==5){
								if (b==2)
									continue;}
							if (c==1||c==2){
								if (a!=5)
									continue;}
							if (c==3||c==4||c==5){
								if (a==5)
									continue;}
							if (d==1||d==2){
								if (c==1)
									continue;}
							if (d==3||d==4||d==5){
								if (c!=1)
									continue;}
							if (e==1||e==2){
								if (d!=1)
									continue;}
							if (e==3||e==4||e==5){
								if (d==1)
									continue;}
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
						}
					
					}


	return 0;
}
int main()
{int A,B,C,D,E,ans[6]={-1,1,1,0,0,0};    //?????? ???????????? 
 for(A=1;A<6;A++) for(B=1;B<6;B++) for(C=1;C<6;C++) for(D=1;D<6;D++) for(E=1;E<6;E++)   //?????? 
  if(A!=B&&A!=C&&A!=D&&A!=E&&B!=C&&B!=D&&B!=E&&C!=D&&C!=E&&D!=E&&E!=2&&E!=3)   //?? ?????? ? E??2?3? ??? 
   if((E==1)==ans[A] && (B==2)==ans[B] && (A==5)==ans[C] && (C!=1)==ans[D] && (D==1)==ans[E])  //??5?????????????? 
    cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E<<endl;

 return 0;
    }
int main()
{int A,B,C,D,E,n,p=0;
for(A=3;A<=5&&(p==0);A++)
   {
    for(B=1;B<=5&&(p==0);B++)
       { if(A==B)continue;
       for(C=1;C<=5&&(p==0);C++)
          {if(B==C||A==C)continue;
           for(D=1;D<=5&&(p==0);D++)
             {if(C==D||A==D||B==D)continue;
               for(E=4;E<=5&&(p==0);E++)//E????1?2?3
                    { if(D==E||E==A||E==C||E==B)continue;
                    n=(B==2)+(A==5)+(C!=1)+(D==1);//A??????
                      if(E==4&&D!=1&&n==2&&B==2) {p=1;E--;A--;B--;C--;D--;}
                      if(E==5&&n==2&&D!=1) {
                            if(B==2&&C==1) {p=1;E--;A--;B--;C--;D--;}
                            
                         
                            }
                            }}}}}
                   if(p)  cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<E;                     
}
int main()
{int a[5];
 int i,j;
 int cc[5];
 int o=1;
 int k[6]={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]++)
                                                    {if((a[0]!=a[1])&&(a[0]!=a[2])&&(a[0]!=a[3])&&(a[0]!=a[4])&&(a[4]==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])&&(a[2]==1))
                                                       {cc[0]=(a[4]==1);
                                                        cc[1]=(a[1]==2);
                                                        cc[2]=(a[0]==5);
                                                        cc[3]=(a[2]!=1);
                                                        cc[4]=(a[3]==1);
                                                        for(j=1;j<=2;j++)
                                                        {for(i=0;i<=4;i++)
                                                           {if((a[i]==j)&&(cc[i]==1))
                                                           k[j]=1;
                                                           }
                                                        }
                                                        for(j=3;j<=5;j++)
                                                        {for(i=0;i<=4;i++)
                                                           {if((a[i]==j)&&(cc[i]==0))
                                                           k[j]=1;

                                                           }
                                                        }

                                                       if((k[1]==1)&&(k[2]==1)&&(k[3]==1)&&(k[4]==1)&&(k[5]==1))
                                                       {for(i=0;i<=3;i++)
                                                       {cout<<a[i]<<" ";}
                                                       cout<<a[4];
                                                       }

                                                    }
                                                    k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=0;

                                               }

                             }
     }
   }
}
   return 0;
}
int deter(int *a)
{	
	int b[5],i,t[5];
	for(i=0;i<5;i++)b[a[i]]=i;	
	t[0]=a[4]==0;
	t[1]=a[1]==1;
	t[2]=a[0]==4;
	t[3]=a[2]!=0;
	t[4]=a[3]==0;
	if(t[b[0]]==1&&t[b[1]]==1&&t[b[2]]==0&&t[b[3]]==0&&t[b[4]]==0)return 1;
	else return 0;
}
int fr(int*n,int p)
{int q;
	for(q=0;q<p;q++)
		if(n[q]==n[p])return 0;
	return 1;
}
void main()
{	int a[5];
	for(a[0]=0;a[0]<5;a[0]++)
	{
		for(a[1]=0;a[1]<5;a[1]++)
		{if(fr(a,1))
			for(a[2]=0;a[2]<5;a[2]++)
			{if(fr(a,2))
				for(a[3]=0;a[3]<5;a[3]++)
				{if(fr(a,3))
					for(a[4]=0;a[4]<5;a[4]++)
					{if(fr(a,4)&&deter(a)&&a[4]!=1&&a[4]!=2)	
						printf("%d %d %d %d %d\n",a[0]+1,a[1]+1,a[2]+1,a[3]+1,a[4]+1);
					}
				}
			}
		}
	}
}
int a,b,c,d,e;
int _a(){return (a<3)^(e==1);}
int _b(){return (b<3)^(b==2);}
int _c(){return (c<3)^(a==5);}
int _d(){return (d<3)^(c!=1);}
int _e(){return (e<3)^(d==1);}
int chk(){
if((a+b+c+d+e!=15)||(a*b*c*d*e!=120))return 1;
return _a()+_b()+_c()+_d()+_e();
}
int main(){
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==1)?e=4:e++)
if(!chk())cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
return 0;
}
/* Note:Your choice is C IDE */
void main()
{int a,b,c,d,e;
	for(a=1;a<=5;a++)
	for(b=1;b<=5;b++)
	for(c=1;c<=5;c++)
	for(d=1;d<=5;d++)
	for(e=1;e<=5;e++)
	{if(a==b||a==c||a==d||a==e||b==c||b==d||b==e||c==d||c==e||d==e)continue;
		if(e!=1&&d!=1&&e!=2&&e!=3&&a>2&&d>2&&c==1&&e!=5&&c==1&&a==5)
		printf("%d %d %d %d %d\n",a,b,c,d,e);}
    
}
int main()
{
	int a[6], A[6] = {0}, count, i;
	for (a[1] = 1; a[1] <= 5; a[1]++)
	{
		for (a[2] = 1; a[2] <= 5; a[2]++)
		{
			if (a[2] != a[1])
			{
				for (a[3] = 1; a[3] <= 5; a[3]++)
				{
					if (a[3] != a[1] && a[3] != a[2])
					{
						for (a[4] = 1; a[4] <= 5; a[4]++)
						{
							if (a[4] != a[1] && a[4] != a[2] && a[4] != a[3])
							{
								for (a[5] = 1; a[5] <= 5; a[5]++)
								{
									if (a[5] != a[1] && a[5] != a[2] && a[5] != a[3] && a[5] != a[4] && a[5] != 2 && a[5] != 3)
									{
										count = 0;
										A[1] = (a[5] == 1);
										A[2] = (a[2] == 2);
										A[3] = (a[1] == 5);
										A[4] = (a[3] != 1);
										A[5] = (a[4] == 1);
										for (i = 1; i <= 5; i++)
										{
											if ((a[i] == 1 || a[i] == 2) && A[i] == 1)
											{
												count++;
											}
											else if ((a[i] != 1 && a[i] != 2) && A[i] == 0)
											{
												count++;
											}
										}
										if (count == 5)
										{
											cout << a[1] << " " << a[2] << " " << a[3] << " " << a[4] << " " << a[5] << endl;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int A, B, C, D, E;
					E=15-A-B-C-D;
					A=5;B=2;C=1;D=3;E=4;

	cout << A <<" " << B << " " <<  C << " " << D << " " << E << endl;
	return 0;
}