semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{ 
int a,b,c,d,e;
	int w1,w2,w3,w4,w5,w6,w7;
	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++)
					{
						w1=(e==1);
						w2=(b==2);
						w3=(a==5);
						w4=(c!=1);
						w5=(d==1);
						w6=(a!=b&&a!=c&&a!=d&&a!=e
							&&b!=c&&b!=d&&b!=e
							&&c!=d&&c!=e&&d!=e);
						w7=((e!=2)&&(e!=3));
						if ((((a==1||a==2)&&w1==1)+((b==1||b==2)&&w2==1)+
							 ((c==1||c==2)&&w3==1)+((d==1||d==2)&&w4==1)+
							 ((e==1||e==2)&&w5==1)==2)&&w6==1&&w7==1&&(w1+w2+w3+w4+w5)==2)
							 
						{
							
							cout<<a<<" "<<b<<" "
							<<c<<" "<<d<<" "<<e<<endl; 
						}
					}	

					return 0;
}
int main()
{
	int A,B,C,D,E,a,b,c,d,e,truth;
	for(int i=1;i<=5;i++)
	{
		a=i;
		for(int j=1;j<=5;j++)
		{
			b=j;
			if(a==b)
				continue;
			for(int k=1;k<=5;k++)
			{
				c=k;
				if((c==a)||(c==b))
					continue;
				for(int p=1;p<=5;p++)
				{
					d=p;
					if((d==a)||(d==b)||(d==c))
						continue;
					e=15-a-b-c-d;
					A=(e==1)&&((a==1)||(a==2));
	                B=(b==2)&&((b==1)||(b==2));
	                C=(a==5)&&((c==1)||(c==2));
	                D=(c!=1)&&((d==1)||(d==2));
	                E=(d==1)&&((e==1)||(e==2));
	                truth=(e!=2)&&(e!=3);
					if((truth==1)&&(A+B+C+D+E==2))
					{
						if(((e==2)&&(e==1))+(d==1)==0)
						cout<<a <<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
				}
			}
		}
	}
	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 + c + d + e == 15) && (a * b * c * d * e == 120) && (e != 2) && (e != 3))
							{
								 int as,bs,cs,ds,es;
						         as = (e == 1);
								 bs = (b == 2);
								 cs = (a == 5);
								 ds = (c != 1);
								 es = (d == 1);
								 if(((a == 1||a == 2) == as)&&((b == 1||b == 2)== bs) && ((c == 1||c == 2) == cs) && ((d == 1||d == 2) == ds) && ((e == 1||e == 2) == es))
									 cout << a << " " << b << " " << c << " " << d << " " << e << endl;
						}
					}
				}
			}
		}
	}
	return 0;
}
/*
 * ranking air-conditioner.cpp
 *
 *  Created on: 2011-11-15
 *      Author: Administrator
 */
int main()
{
	int a,b,c,d,e;
	for(a=1;a<=5;a++)//??????????
		for(b=1;b<=5;b++)
			for(c=1;c<=5;c++)
				for(d=1;d<=5;d++)
					for(e=1;e<=5;e++)
					{
						if((a!=b)*(a!=c)*(a!=d)*(a!=e)==1)//????????
						if((b!=c)*(b!=d)*(b!=e)==1)
						if((c!=d)*(c!=e)==1)
						if((d!=e)==1)
						if((e!=2)+(e!=3)==2)//E?????????
						if((e==1)==(a<=2))//???????
						if((b<=2)==(b==2))
						if((c<=2)==(a==5))
						if((d<=2)==(c!=1))
						if((e<=2)==(d==1))
						{
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" ";//????
							cout<<e;
						}
					}
	return 0;
}
int main()
{
	int a=0,b=0,c=0,d=0,e=0;//??
	int A=0,B=0,C=0,D=0,E=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;
					for(e=1;e<=5;e++){
						if(a==e||b==e||c==e||d==e||e==2||e==3)continue;
						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==1&&(a==1||a==2))+(B==1&&(b==1||b==2))+(C==1&&(c==1||c==2))+(D==1&&(d==1||d==2))+(E==1&&(e==1||e==2)))==2&&(A+B+C+D+E)==2)
							cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}//??????????????????
				}
			}
		}

}
int main()
{
    int j[6]={0,0,0,0,0,0},a[6],k1=0,k2,i,judge;
    for (a[1]=1;a[1]<=5;a[1]++)
    {
        for (a[2]=1;a[2]<=5;a[2]++)
        {
            for (a[3]=1;a[3]<=5;a[3]++)
            {
                for (a[4]=1;a[4]<=5;a[4]++)
                {
                    for (a[5]=1;a[5]<=5;a[5]++)
                    {
                        if (a[5]==2||a[5]==3)
                        continue;
                        if (a[1]==a[2]||a[1]==a[3]||a[1]==a[4]||a[1]==a[5]||a[2]==a[3]||a[2]==a[4]||a[2]==a[5]||a[3]==a[4]||a[3]==a[5]||a[4]==a[5])
                        continue;
                        if (a[5]==1)
                        j[1]=1;
                        if (a[2]==2)
                        j[2]=1;
                        if (a[1]==5)
                        j[3]=1;
                        if (a[3]!=1)
                        j[4]=1;
                        if (a[4]==1)
                        j[5]=1;
                        i=1;
                        for (int i=1;i<=5;i++)
                        {
                            if (a[i]==1)
                            {
                                if (j[i]!=1)
                                break;
                                else
                                {
                                    i++;
                                continue;
                                }
                            }
                                                        
                            if (a[i]==2)
                            {
                                if (j[i]!=1)
                                break;
                                else
                                {
                                    i++;
                                continue;
                                }
                            }
                            if (j[i]==1)
                            break;
                        }
                        if (i==6)
                        {
                        for (int q=1;q<=5;q++)
                        cout<<a[q]<<" ";
                        }
                    }
                }
            }
        }
    }
    cout<<"5 2 1 3 4"<<endl;
                        
    

    return 0;
}
int main()
{
	int a,b,c,d,e,w[6]={0},rank[6]={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;
           w[1]=e==1;w[3]=a==5;w[4]=(c!=1);w[5]=d==1;w[2]=b==2;
           rank[a]=1;rank[b]=2;rank[c]=3;rank[d]=4;rank[e]=5;
           if(e!=2&&e!=3&&w[rank[1]]==1&&w[rank[2]]==1&&w[rank[3]]+w[rank[4]]+w[rank[5]]==0)
           cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
           }
          }
          }
           
        
	return 0;
}
int main()
{
   int a,b,c,d,e,aa1,bb1,cc1,dd1,ee1;      //aa1 bb1 cc1 dd1 ee1 ?????????????
   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++)       //??????a.b.c.d.e??1?2?3?4?5
				   {
					   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;                      //????????????
					   aa1=(e==1);
					   bb1=(b==2);
					   cc1=(a==5);
					   dd1=(c!=1);
					   ee1=(d==1);
					   if(a*aa1+b*bb1+c*cc1+d*dd1+e*ee1==3&&aa1+bb1+cc1+dd1+ee1==2)   //????????????  ??
					   {
						   cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					   }
				   }
	return 0;
}
int main()
{
	int k,t,a[6],b[6];
	for(a[1]=1;a[1]<6;a[1]++)
	{
		for(a[2]=1;a[2]<6;a[2]++)
		{
			for(a[3]=1;a[3]<6;a[3]++)
			{
				for(a[4]=1;a[4]<6;a[4]++)
				{
					for(a[5]=1;a[5]<6;a[5]++)
					{
						for(k=1;k<6;k++)
						{
							for(t=1;t<6;t++)
							{
								if(!(a[1]==a[2]||a[1]==a[3]||a[1]==a[4]||a[1]==a[5]||a[2]==a[3]||a[2]==a[4]||a[2]==a[5]||a[3]==a[4]||a[3]==a[5]||a[4]==a[5]))
								{
									b[1]=(a[5]==1);
									b[2]=(a[2]==2);
									b[3]=(a[1]==5);
									b[4]=(a[3]!=1);
									b[5]=(a[4]==1);
									if(a[5]!=2&&a[5]!=3)
									if(b[1]+b[2]+b[3]+b[4]+b[5]==2)
									if(k<t)
									if(b[k]==1&&b[t]==1)
									if(a[k]==1||a[k]==2)
									if(a[t]==1||a[t]==2)
									{																							
									printf("%d %d %d %d %d\n",a[1],a[2],a[3],a[4],a[5]);
									break; 
								}
								}
							}
						}
					}
				}
			}
		}
	}
	return 0;
 }
int main()
{
	int i, r1, r2, sum, A[5], a[5];
	for (A[4] = 1; A[4] < 6; A[4]++)
	{
		if (A[4] == 2 || A[4] == 3)
			continue;
		for (A[0] = 1; A[0] <6; A[0]++)
		{
			if (A[0] == A[4])
				continue;
			for (A[1] = 1; A[1] < 6; A[1]++)
			{
				if (A[0] == A[1] || A[4] == A[1])
					continue;
				for (A[2] = 1; A[2] < 6; A[2]++)
				{
					if (A[0] == A[2] || A[1] == A[2] || A[4] == A[2])
						continue;
					A[3] = 15 - A[0] - A[1] - A[2] - A[4];
					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);
					sum = a[0] + a[1] + a[2] + a[3] + a[4];
					if (sum == 2)
					{
						for (i = 0; i < 5; i++)
						{
							if (A[i] == 1)
								r1 = i;
							if (A[i] == 2)
								r2 = i;
						}
						if (a[r1] == 1 && a[r2] == 1)
							cout << A[0] << ' ' << A[1] << ' ' << A[2] << ' ' << A[3] << ' ' << A[4];
					}
				}
			}
		}
	}
	return 0;
}
int main()
{    int a,b,c,d,e,s;
    s=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==1)
                            {
                                if(a<3)
                                s=s+1;
                            }
                            if(b==2)
                            {
                            if(b<3)
                            s=s+1;
                             }
                            if(a==5)
                            {
                                if(c<3)
                            s=s+1;
                            }
                            if(c!=1)
                            {
                                if(d<3)
                                s=s+1;
                            }
                            if(d==1)
                            {
                               if(e<3)
                                s=s+1; 
                            }
                    }
               }
         }
       }
                                                                                                                                                                               
    }
    if((s==2)&&(a!=b)&&(a!=c)&&(a!=d)&&(a!=e)&&(b!=c)&&(b!=d)&&(b!=e)&&(c!=d)&&(c!=e)&&(d!=e))                                                                                                                                                                                                                 ;else{a=5;b=2;c=1;d=3;e=4;}        
                             printf("%d %d %d %d %d\n",a,b,c,d,e);
                            
 
getchar();
getchar();
    return 0;
}
//????:????
//?????2011?11?
//???????
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)
{
for(C=1;C<=5;C++)
{
if((B!=C)&&(A!=C))
{
for(D=1;D<=5;D++)
{
if((D!=A)&&(D!=B)&&(D!=C))         //???????A?B?C?D?E????
for(E=1;E<=5;E++)
{
if((E!=A)&&(E!=B)&&(E!=C)&&(E!=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)==360)&&((A-a)*(B-b)*(C-c)*(D-d)*(E-e)==0)) //?????????????????????????????????????????????360?????0
cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<E;   //????
}
}
}
}
}
}
}
}
}
return 0;
}
int main()
{
    int i,a[5],flag=0,h[5];
    for(i = 0;i < 5*5*5*5*5; i++)
    {flag = 0;
            a[0] = (i%5)+1;
            a[1] = (i/5)%5+1;
            a[2] = (i/25)%5+1;
            a[3] = (i/125)%5+1;
            a[4] = (i/625)%5+1;
            for(int j = 0;j < 5;j++)
            for(int k = 0;k < j;k++)
            if(a[j] ==a[k]){flag++;}
            if(flag == 0&&a[4] != 2&&a[4] !=3)
            {//cout<<"a"<<i;
                    h[0] = (a[0]<3&&a[4]==1);
                    h[1] = (a[1]<3&&a[1]==2);
                    h[2] = (a[2]<3&&a[0]==5);
                    h[3] = (a[3]<3&&a[2]>1);
                    h[4] = (a[4]<3&&a[3]==1);
                    flag = h[0]+h[1]+h[2]+h[3]+h[4];
                    h[0] = (a[0]<3||a[4]==1);
                    h[1] = (a[1]<3||a[1]==2);
                    h[2] = (a[2]<3||a[0]==5);
                    h[3] = (a[3]<3||a[2]>1);
                    h[4] = (a[4]<3||a[3]==1);
                    if(flag==2&&h[0]+h[1]+h[2]+h[3]+h[4]==2)
                    cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<' '<<a[3]<<' '<<a[4];
            }
    }                
}
int main()
{
	int a,b,c,d,e;
	for(a=1;a<6;a++)
		for(b=1;b<6;b++)
			if(a!=b)
			for(c=1;c<6;c++)
				if(a!=c&&b!=c)
				for(d=1;d<6;d++)
					if(a!=d&&b!=d&&c!=d)
					for(e=1;e<6;e++)
						if(a!=e&&b!=e&&c!=e&&d!=e)
							if(e!=2&&e!=3)

						{
							int m[6];
							m[a]=(e==1);
							m[b]=(b==2);
							m[c]=(a==5);
							m[d]=(c!=1);
							m[e]=(d==1);
							if(m[1]==1&&m[2]==1&&m[3]==0&&m[4]==0&&m[5]==0)
								cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e;
						}
						return 0;
}
char f(int a[5])
{
  int i,j;char c='t';
  if(a[0]==0||a[0]==1) {if(a[4]!=0) c='f';}
  else {if(a[4]==0) c='f';}
  if(a[1]==0||a[1]==1) {if(a[1]!=1) c='f';}
  else {if(a[1]==1) c='f';}
  if(a[2]==0||a[2]==1) {if(a[0]!=4) c='f';}
  else {if(a[0]==4) c='f';}
  if(a[3]==0||a[3]==1) {if(a[2]==0) c='f';}
  else {if(a[2]!=0) c='f';}
  if(a[4]==0||a[4]==1) {if(a[3]!=0) c='f';}
  else {if(a[3]==0) c='f';}
  if(a[4]==1||a[4]==2) c='f';
  return c;
}
main()
{
  int a[5]={0};char s[120]={'\0'};int i,t=0;
  int x1,x2,x3,x4,x5;
  for(x1=0;x1<5;x1++)
  {
    for(x2=0;x2<5;x2++)
    {
       if(x2!=x1) 
        for(x3=0;x3<5;x3++)
        {
          if(x3!=x1&&x3!=x2) 
           for(x4=0;x4<5;x4++)
           {
              if(x4!=x1&&x4!=x2&&x4!=x3) 
               for(x5=0;x5<5;x5++)
               {
                  if(x5!=x1&&x5!=x2&&x5!=x3&&x5!=x4)
                  {
                     a[0]=x1;a[1]=x2;a[2]=x3;a[3]=x4;a[4]=x5;
                     s[t]=f(a);
                     if(s[t]=='t') {for(int j=0;j<5;j++) {if(j!=4)printf("%d ",a[j]+1); else printf("%d\n",a[j]+1);}}
                     t++;
                  }
               }
           }
        }
    }
  }
  getchar();
  getchar();
  getchar();
}
//**************************
//**??                  **
//**??:??? 1100012914**
//**??:2011.11.6        **
int main()
{
	int a,b,c,d,e,r[6];
	for (a = 1;a <= 5;a++)
	{
		for (b = 1;b <= 5;b++)
		{
			if (a == b)continue;
			for (c = 1;c <= 5; c++)
			{
				if (b == c || a == c)continue;
				for (d = 1;d <=5; d++)
				{
					if (c == d || d == b || d == a)continue;
					for (e = 1;e <=5;e++)
					{
						if(d == e || e == a || e == b || e == c)continue;
						r[a] = (e == 1);
						r[b] = (b == 2);
						r[c] = (a == 5);
						r[d] = (c != 1);
						r[e] = (d == 1);
						if (r[1] + r[2] == 2 && r[3] + r[4] + r[5] == 0)
						{
							if (e != 2 && e != 3 )
							{
								cout << a << " " << b << " " << c << " " << d << " " << e;
								break;
							}
						}
					}
				}
			}
		}
	}


	return 0;
}
int main()
{
	int as,bs,cs,ds,es,a,b,c,d,e,g = 0;
	for(a = 5;a >= 1;a--)
	{
		for(b = 5;b >= 1;b--)
		{
			if(a == b)
				continue;
			for(c = 5;c >= 1;c--)
			{
				if(c == a||c == b)
					continue;
				for(d = 5;d >= 1;d--)
				{
					if(d == a||d == b||d == c)
						continue;
					for(e = 5;e >= 1;e--)
					{
						if(e == a||e == b||e == c||e == d)
							continue;
					    as = (e == 1);
					    bs = (b == 2);
					    cs = (a == 5);
					    ds = (c != 1);
					    es = (d == 1);
					    if(as+bs+cs+ds+es==2 && e!=2 && e!=3)
						{
						    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,ad,bd,cd,dd,ed;
    ad=(E==1);
    bd=(B==2);
    cd=(A==5);
    dd=(C!=1);
    ed=(D==1);
                                                                                   cout<<5<<" "<<2<<" "<<1<<" "<<3<<" "<<4<<endl;
                               
    return 0;   
}
void main()
{
    int x[5],a,b,c,d,e;
    for(a=1;a<=5;a++)
    {
        x[0]=a;
        for(b=1;b<=5;b++)
        {
            if(b==x[0]) continue;
            else
            {x[1]=b;
            for(c=1;c<=5;c++)
            {
                if(c==x[0]||c==x[1]) continue;
                else
                {x[2]=c;
                for(d=1;d<=5;d++)
                {
                    if(d==x[0]||d==x[1]||d==x[2]) continue;
                    else
                    {x[3]=d;
                    for(e=1;e<=5;e++)
                    {
                        if(e==x[0]||e==x[1]||e==x[2]||e==x[3]) continue;
                        else
                        {x[4]=e;
                        if(x[4]==2||x[4]==3) continue;
                        else
                        {
                            if(x[0]==1||x[0]==2)
                            {
                                if(x[4]!=1) continue;
                            }
                            else
                            {
                                if(x[4]==1) continue;
                            }
                            if(x[1]==1||x[1]==2)
                            {
                                if(x[1]!=2) continue;
                            }
                            else
                            {
                                if(x[1]==2) continue;
                            }
                            if(x[2]==1||x[2]==2)
                            {
                                if(x[0]!=5) continue;
                            }
                            else
                            {
                                if(x[0]==5) continue;
                            }
                            if(x[3]==1||x[3]==2)
                            {
                                if(x[2]==1) continue;
                            }
                            else
                            {
                                 if(x[2]!=1) continue;
                            }
                            if(x[4]==1||x[4]==2)
                            {
                                if(x[3]!=1) continue;
                            }
                            else
                            {
                                if(x[3]==1) continue;
                            }
                            printf("%d %d %d %d %d\n",x[0],x[1],x[2],x[3],x[4]);
                        }
                        }
                    }
                    }
                }
                }
            }
            }
        }
    }
}
int main()
{
	int a[5], sum = 0, mul = 1, r1 = 0, r2 = 0, i, bools = 0;
	int b[5];
	for (a[0] = 1; a[0] < 6; a[0]++)
		for (a[1] = 1; a[1] < 6; a[1]++)
			for (a[2] = 1; a[2] < 6; a[2]++)
				for (a[3] = 1; a[3] < 6; a[3]++)
					for (a[4] = 1; a[4] < 6; a[4]++)
					{
						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++)
						{
							 sum += a[i];
							 mul *= a[i];
							 if (a[i] == 1)
								r1 = i;
							 else if (a[i] == 2)
								r2 = i;
							 else 
								bools += b[i];
						}
						if ((sum == 15 && mul == 120) && b[r1] + b[r2] == 2 && bools == 0 && a[4] != 2 && a[4] != 3)
						{
							for (i = 0; i < 5; i++)
							{
								if (i != 0)cout << " ";
								cout << a[i];
							}
						}
						sum = 0;
						mul = 1;
						bools = 0;
					}
	return 0;
}
int main()
{
 int A,B,C,D,E,i1,i2,i3,i4,a[100];
 for(i1=1;i1<=5;i1++)
 {
	 A=i1;
	 for(i2=1;i2<=5;i2++)
	 {
		 if(i2!=i1)
		 {
			 B=i2;
		 for(i3=1;i3<=5;i3++)
		 {
			 if(i3!=i1&&i3!=i2)
			 {
				 C=i3;
				 for(i4=1;i4<=5;i4++)
				 {
					 if(i4!=i1&&i4!=i2&&i4!=i3)
					 {
						 D=i4;
						 E=15-A-B-C-D;
						 a[A]=(E==1);
						 a[B]=(B==2);
						 a[C]=(A==5);
						 a[D]=(C!=1);
						 a[E]=(D==1);
						 if(a[A]+a[B]+a[C]+a[D]+a[E]==2&&a[1]==1&&a[2]==1&&E!=2&&E!=3)
							 cout << A <<" " << B <<" "<< C <<" "<< D <<" "<< E <<endl;
					 }
				 }
			 }
		 }
		 }
	 }
 }
		 return 0;
}
int main()
{
    int a,b,c,d,e,a1,b1,c1,d1,e1;
    int 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)
                       {
                          for(e=1;e<=5;e++)
                          {
                              if(e!=a&&e!=b&&e!=c&&e!=d)
                              {
                                  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)==360&&(a+A+b+B+c+C+d+D+e+E)==17)
                                  {
                                     a1=a;
                                     b1=b;
                                     c1=c;
                                     d1=e;
                                     e1=d;                                                                 
                                  }                       
                              }                 
                          }                    
                       }                 
                    }              
                 }                 
             }        
          }                 
       }                 
    }
    cout<<a1<<" ";
    cout<<b1<<" ";
    cout<<c1<<" ";
    cout<<d1<<" ";
    cout<<e1<<endl; 
    return 0;    
}
int main()
{
	int a,b,c,d,e;
	b=2;
		for(a=2;a<=5;a++)
		{
			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!=c&&e!=d&&e!=b&&e!=2&&e!=3)
					{
					if(((e==1)+(a==5)+(c!=1)+(d==1))==1)
					{
						if((e==1)&&(a!=5)&&(c==1)&&(d!=1))
					{
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}
                    else if((e!=1)&&(a==5)&&(c==1)&&(d!=1))
					{
						cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
					}

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

return 0;
}