semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int f[5];
    char m[5]={'0','z','q','s','l'};
    int a,b,c,d,i,j,k;
    char n;
    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)==(c+d))
    if ((a+d)>(b+c))
    if ((a+c)<b)
    {
        f[1]=a;f[2]=b;f[3]=c;f[4]=d;
        break;
    }
    for (i=2;i<=4;i++)
      for (j=1;j<i;j++)
      if (f[i]>f[j])
      {
        k=f[i];f[i]=f[j];f[j]=k;
        n=m[i];m[i]=m[j];m[j]=n;
      }
    for (i=1;i<=4;i++)
    cout <<m[i] <<" "<<f[i]*10 <<endl;
    return 0;
}
int main()
{
	int z,q,s,l,k,m,d;
	char a[4]={'z','q','s','l'};
	char c,f=8;

	int i=0;
	for(z=0;z<=50;z=z+10)
	{
		for(q=0;q<=50;q=q+10)
		{
			for(s=0;s<=50;s=s+10)
			{
				for(l=0;l<=50;l=l+10)
				{
					if (((z+q)==(s+l))&&((z+l)>(s+q))&&((z+s)<q)&&(z*s*q*l!=0))
					{
						i=1;
						break;
					}
					if (i) break;
				}
				if (i) break;
			}
			if (i) break;
		}
		if (i) break;
	}
    int b[4]={z,q,s,l};
    for(d=0;d<4;d++)
    {
        for(k=3;k>0;k--)
        {
            if (b[k]>b[k-1])
            {
            m=b[k];
            b[k]=b[k-1];
            b[k-1]=m;
            c=a[k];
            a[k]=a[k-1];
            a[k-1]=c;
            }
        }
    }
    for(d=0;d<4;d++) printf("%c %d\n",a[d],b[d]);
    printf("%c%c%c%c",f,f,f,f);
	return 0;
}
int main()
{
	int z,q,s,l,i,s1,s2,s3;                                        //??z,q,s,l????
    char a[5]={' '};                                               //???????a[5]??????
	for(z=1;z<=5;z++){                                             //???z,q,s,l
		for(q=1;q<=5;q++){
			if(z==q) continue;
			for(s=1;s<=5;s++){
				if(s==z||s==q) continue;
				for(l=1;l<=5;l++){
					if(l==z||l==q||l==s) continue;
					s1=(z+q==s+l);
					s2=(z+l>s+q);
					s3=(z+s<q);
					if(s1+s2+s3==3){
						a[z]='z';
						a[q]='q';
						a[s]='s';
						a[l]='l';
						for(i=5;i>=1;i--){                         //?????
							if(a[i]!=0)
								cout<<a[i]<<" "<<i*10<<endl;}}}}}}
	return 0;
}
//**********************************
//* ???8.cpp  **
//* ?????? 1200012971 **
//* ???????????? **
//* ???2012.10.11**
//**********************************
int main()
{
	int i,j,t,a,b,c,d;                 //???????a,b,c,d?????,?????t
	int x[4];                                           //????
	char name[4];                                    //????????????
	char k;                                        //?????k
	for (a = 10; a < 50; a += 10 )                             //?????????????????????
	{
		for (b = 10; b < 50; b += 10 )
		{
			if (a != b)                             //a?b??????
			{
				for(c = 10; c < 50; c += 10)
				{
				  if(b != c && a != c)                       //c?a?b???????
				  { 
					  for(d = 10; d < 50; d += 10 )
					  {
					     if(a != d && b != d && c != d)             //d?a?b?c???????
						 {
						    if( (a + b == c + d) && (a + d > b + c) && (a + c < b))   //??????????????
								break;
						 }
					  }
					  if( (a + b == c + d) && (a + d > b + c) && (a + c < b))   //?????????????
						  break;
				  }
				}
				if( (a + b == c + d) && (a + d > b + c) && (a + c < b))   //?????????????
					break;
			}
		}
		if( (a + b == c + d) && (a + d > b + c) && (a + c < b))   //?????????????
			break;
	}
	x[0] = a;                                                     //??????????
	x[1] = b;
	x[2] = c;
	x[3] = d;
	name[0] = 'z';                                           //??????????
	name[1] = 'q';
	name[2] = 's';
	name[3] = 'l';
	for(j = 0;j < 3;j ++ )                           //????????????
	{
		for (i = 0;i < 3 - j;i ++ )
		{
			if ( x[i] < x[i + 1])
			{
				t = x[i];x[i] = x[i + 1];x[i + 1] = t;
				k = name[i];name[i] = name[i + 1];name[i + 1] = k;
			}
		}
	}
	for( i = 0;i < 4;i ++ )                            //????????? ??
		cout << name[i] << " " << x[i] << endl;
	return 0;
}
int main(){
	int z,q,s,l;
	for(z=10;z<=50;z+=10)
	for(q=10;q<=50;q+=10)
	for(s=10;s<=50;s+=10)
	for(l=10;l<=50;l+=10){
		if(z!=q&&z!=s&&z!=l&&q!=s&&q!=l&&s!=l&&z+q==s+l&&z+l>s+q&&z+s<q){
		 	int a[4]={z,q,s,l},i,j,m;
		 	char b[4]={'z','q','s','l'},n;
			for(i=0;i<3;i++)
			for(j=0;j<3-i;j++){
				if(a[j]<a[j+1]){
					m=a[j];n=b[j];
					a[j]=a[j+1];b[j]=b[j+1];
					a[j+1]=m;b[j+1]=n;
				}
			}
			for (i=0;i<4;i++){
				printf("%c %d\n",b[i],a[i]);
			}
		} 
	}
	return 0;
}
/*
 * exercise1015.cpp
 *
 *  Created on: 2012-10-15
 *      Author: wangyinzhi
 */


int main(){
   int a,b,c,d;
   int k[5],i,j,p;
   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==c+d)&&(a+d>c+b)&&(a+c<b)){//?????abcd????zqsl?????????
					   	k[1]=a;
					   	k[2]=b;
					   	k[3]=c;
					   	k[4]=d;//????
					   	for (j=1;j<=3;j++){
					   		for(i=1;i<=4-j;i++){
					   			if(k[i]<k[i+1]){
					   				p=k[i];
					   				k[i]=k[i+1];
					   				k[i+1]=p;//???????????
					   			}
					   		}
					   	}
					   	for(i=1;i<=4;i++){
					        if (k[i]==a)
					        	cout<<"z"<<" "<<k[i]*10<<endl;
					        if (k[i]==b)
					        	cout<<"q"<<" "<<k[i]*10<<endl;
					        if (k[i]==c)
					        	cout<<"s"<<" "<<k[i]*10<<endl;
					        if (k[i]==d)
					        	cout<<"l"<<" "<<k[i]*10<<endl;//???????????????

					   	}

				       }

				   }

			   }
		   }
	   }

	return 0;
}
int main()
{
	int z,q,s,l,a[4],t;
	for(z=1;z<=5;z++)
	{
		for(q=1;q<=5;q++)
		{
			if(z!=q)
				for(s=1;s<=5;s++)
				{
					if(s!=q&&s!=z)
						for(l=1;l<=5;l++)
						{
							if(l!=z&&l!=q&&l!=s&&(z+q)==(s+l)&&(z+l)>(s+q)&&(z+s)<q)
							{
								a[0]=z;
								a[1]=q;
								a[2]=s;
								a[3]=l;
								for(int i=0;i<=2;i++)
								{
									for(int j=3;j>i;j--)
									{
										if(a[j]>a[j-1])
										{
											t=a[j];
											a[j]=a[j-1];
											a[j-1]=t;
										}
									}
								}
								for(int i=0;i<=3;i++)
								{
									if(z==a[i])
										printf("\nz %d",10*z);
									if(q==a[i])
										printf("\nq %d",10*q);
									if(s==a[i])
										printf("\ns %d",10*s);
									if(l==a[i])
										printf("\nl %d",10*l);
								}
							}
						}
				}
		}
	}
	return 0;
}
void main()
{
	int a[4],i,j,t;
	char c[4]={'z','q','s','l'},te;
	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 if ((a[0]+a[1]==a[2]+a[3])&&(a[0]+a[3]>a[2]+a[1])&&(a[0]+a[2]<a[1]))
							{
								for  (i=0;i<4;i++)
								{
									for (j=0;j<3-i;j++)
									{
							     		if (a[j]<a[j+1])
										{
								    		t=a[j];
								    		a[j]=a[j+1];
								    		a[j+1]=t;
								    		te=c[j];
									    	c[j]=c[j+1];
										    c[j+1]=te;
										}
									}
								}
						    		for (i=0;i<4;i++)
							    	printf("%c %d\n",c[i],10*a[i]);
								}
						}
				}
		}
	}
}
int main()
{int z,q,s,l,a,b;

for(z=1;z<6;z++)
{
  for(s=1;s<6;s++)
  {
	  l=7-s;q=7-z;
         if((z+l>q+s)&&(z+s<q))
	 
		 {	a=s;b=z;}	}
}		 
  

l=6-a;q=6-b;
   printf("l %d\n",l*10);
printf("q %d\n",q*10);
printf("z %d\n",b*10);
printf("s %d",a*10);

	return 0;
}
int main()
{
    int z,q,s,l,i,j,k,h,a,b,c ;
	for (i=1;i<=5;i++)
	{
		z=i;
		for (j=1;j<=5;j++)
		{
			q=j;
			for (k=1;k<=5;k++)
			{
				s=k;
				for (h=1;h<=5;h++)
				{
					l=h;
					if (z-q!=0&&z-s!=0&&z-l!=0&&q-s!=0&&q-l!=0&&s-l!=0)
					{
						a=((z+q)==(s+l))+((z+l)>(s+q))+((s+z)<q) ;
						if (a==3)
						{
							q=q*10; z=z*10; l=l*10; s=s*10;
						    if (q>l&&l>s&&s>z) cout << "q" << " " << q << endl << "l" << " " << l << endl << "s" << " " << s <<endl << "z" << " " << z <<endl ;
                            if (q>l&&l>z&&z>s) cout << "q" << " " << q << endl << "l" << " " << l << endl << "z" << " " << z <<endl << "s" << " " << s <<endl ;
							if (q>s&&s>l&&l>z) cout << "q" << " " << q << endl << "s" << " " << s << endl << "l" << " " << l <<endl << "z" << " " << z <<endl ;
							if (q>s&&s>z&&z>l) cout << "q" << " " << q << endl << "s" << " " << s << endl << "z" << " " << z <<endl << "l" << " " << l <<endl ;
							if (q>z&&z>s&&s>l) cout << "q" << " " << q << endl << "z" << " " << z << endl << "s" << " " << s <<endl << "l" << " " << l <<endl ;
							if (q>z&&z>l&&l>s) cout << "q" << " " << q << endl << "z" << " " << z << endl << "l" << " " << l <<endl << "s" << " " << s <<endl ;
							
						    if (l>q&&q>s&&s>z) cout << "l" << " " << l << endl << "q" << " " << q << endl << "s" << " " << s <<endl << "z" << " " << z <<endl ;
                            if (l>q&&q>z&&z>s) cout << "l" << " " << l << endl << "q" << " " << q << endl << "z" << " " << z <<endl << "s" << " " << s <<endl ;
							if (l>s&&s>q&&q>z) cout << "l" << " " << l << endl << "s" << " " << s << endl << "q" << " " << q <<endl << "z" << " " << z <<endl ;
							if (l>s&&s>z&&z>q) cout << "l" << " " << l << endl << "s" << " " << s << endl << "z" << " " << z <<endl << "q" << " " << q <<endl ;
							if (l>z&&z>s&&s>q) cout << "l" << " " << l << endl << "z" << " " << z << endl << "s" << " " << s <<endl << "q" << " " << q <<endl ;
							if (l>z&&z>q&&q>s) cout << "l" << " " << l << endl << "z" << " " << z << endl << "q" << " " << q <<endl << "s" << " " << s <<endl ;	
						}
					}
				}
			}
		}
	}


	return 0 ;
}
int main()
{
  int z,q,s,l;
  int a1,a2,a3;
  char name[6];
  int weight[6];
  int i=0;

  for(i=0;i<6;i++)
    weight[i]=0;

  for (z=1;z<=5;z++)
  {   
	  for (q=1;q<=5;q++)
	  {  
		  for (s=1;s<=5;s++)
		  {  
			  for (l=1;l<=5;l++)
			  {   

			      a1=(z+q)==(s+l);
				  a2=(z+l) >(s+q);
				  a3=(z+s) <q;

				  if(a1&&a2&&a3)
				  {
					  name[z]='z'; weight[z]=z*10;
                      name[q]='q'; weight[q]=q*10;
                      name[s]='s'; weight[s]=s*10;
                      name[l]='l'; weight[l]=l*10;
				  }
			  }
		  }
	  }
  }

  
  
  for(i=5;i>=0;i--)
  {
	  if(weight[i]!=0)
	  cout<<name[i]<<" "<<weight[i]<<endl;
  }

return 0;
}
int main ()
{
	int z,q,s,l;//????
	int f(int,int,int,int);//???????????
	for(z=1;z<=5;z++)//??
	{
		for(q=1;q<=5;q++)
		{
			if(q==z)
				continue;//??????
			else
			{
				for(s=1;s<=5;s++)
				{
					if(s==z || s==q)
						continue;
					else
					{
						for(l=1;l<=5;l++)
							if(l==z || l==q || l==s)
								continue;
							else
							{
								if(z+q==l+s && z+l>s+q && z+s<q)//????
									f(z,q,s,l);//????
							}
					}
				}
			}
		}
	}
	return 0;
}
int f(int z,int q,int s,int l)//????
{
	int a[4]={z,q,s,l},i,j,temp1;//????
	char b[5]={"zqsl"},temp2;
	for(i=0;i<3;i++)//???????
		for(j=i+1;j<4;j++)
			if(a[i]<a[j])
			{
				temp1=a[i];
				a[i]=a[j];
				a[j]=temp1;
				temp2=b[i];//???????????
				b[i]=b[j];
				b[j]=temp2;
			}
	for(i=0;i<4;i++)//??
		cout << b[i] << " " << 10*a[i] << endl;
	return 0;//???
}
int main()
{
	char a[5]={'a','z','q','s','l'},char_;
	int z,q,s,l,t,b[5],i,j;
	for (z=1;z<=5;z++)
		for (q=1;q<=5;q++)
			for (s=1;s<=5;s++)
				for (l=1;l<=5;l++)
					if ((z-q)*(z-s)*(z-l)*(q-s)*(q-l)*(s-l)!=0)
						if (z+q==s+l)
							if (z+l>s+q)
								if (z+s<q)
								{
									b[1]=z;b[2]=q;b[3]=s;b[4]=l;
								}
	for (i=1;i<=4;i++)
		for (j=1;j<=4-i;j++)
			if (b[j]<b[j+1])
			{
				t=b[j];b[j]=b[j+1];b[j+1]=t;
				char_=a[j];a[j]=a[j+1];a[j+1]=char_;
			}
	for (i=1;i<=4;i++)
		cout<<a[i]<<" "<<b[i]*10<<endl;
	return 0;
}
int main()
{
	int z,q,s,l,a,b,c,d;
	char A,B,C,D;
	for(z=10;z<=50;z=z+10)
		for(q=10;q<=50;q=q+10)
			for(s=10;s<=50;s=s+10)
				for(l=10;l<=50;l=l+10)
					if(z+q==s+l)
						if(z+l>s+q&&z+s<q)	
						{
							a=z;
							if(a<q)
							{
								b=a;
								a=q;
							}
							else
							{
								b=q;
							}
							if(a<s)
							{
								c=b;
								b=a;
								a=s;
							}
							else
							{
								if(b<s)
								{
									c=b;
									b=s;
								}
								else
								{
									c=s;
								}
							}
							if(a<l)
							{
								d=c;
								c=b;
								b=a;
								a=l;
							}
							else
							{
								if(b<l)
								{
									d=c;
									c=b;
									b=l;
								}
								else
								{
									if(c<l)
									{
										d=c;
										c=l;
									}
									else
									{
										d=l;
									}
								}
							}
							if(a!=b&&b!=c&&c!=d&&a!=c&&a!=d&&b!=d)
							{
								if(z==a)
								{
									A='z';
								}
								if(z==b)
								{
									B='z';
								}
								if(z==c)
								{
									C='z';
								}
								if(z==d)
								{
									D='z';
								}
								if(q==a)
								{
									A='q';
								}
								if(q==b)
								{
									B='q';
								}
								if(q==c)
								{
									C='q';
								}
								if(q==d)
								{
									D='q';
								}
								if(s==a)
								{
									A='s';
								}
								if(s==b)
								{
									B='s';
								}
								if(s==c)
								{
									C='s';
								}
								if(s==d)
								{
									D='s';
								}
								if(l==a)
								{
									A='l';
								}
								if(l==b)
								{
									B='l';
								}
								if(l==c)
								{
									C='l';
								}
								if(l==d)
								{
									D='l';
								}
								cout<<A<<' '<<a<<'\n'<<B<<' '<<b<<'\n'<<C<<' '<<c<<'\n'<<D<<' '<<d<<endl;
							}
						}
	return 0;
}
int main()
{
	int weight[4],k=0,i,t,w[4];
	char name[4]={'z','q','s','l'};char p;
	  for(weight[0]=1;weight[0]<=5;weight[0]++)
		for(weight[1]=1;weight[1]<=5;weight[1]++)
			if(weight[0]!=weight[1])
				for(weight[2]=1;weight[2]<=5;weight[2]++)
					if(weight[2]!=weight[0]&&weight[2]!=weight[1])
						for(weight[3]=1;weight[3]<=5;weight[3]++)
							if(weight[3]!=weight[0]&&weight[3]!=weight[1]&&weight[3]!=weight[2])
								if((weight[0]+weight[1])==(weight[2]+weight[3])&&
									(weight[0]+weight[3])>(weight[1]+weight[2])&&
									(weight[0]+weight[2])<weight[1])
									for(i=0;i<4;i++)
										w[i]=weight[i];
	for(k=1;k<=3;k++)
			for(i=0;i<=3-k;i++)
				if(w[i]<w[i+1]){
					t=w[i];
					w[i]=w[i+1];
					w[i+1]=t;
					p=name[i];
					name[i]=name[i+1];
					name[i+1]=p;}
	for(i=0;i<4;i++)
		cout<<name[i]<<' '<<w[i]*10<<endl;
	return 0;
}
int main()
{
    char a[4] = {'z', 'q', 's', 'l'}, temp1;
    int weight[4], temp;
    for (weight[0] = 10; weight[0] <= 50; weight[0] += 10)
    {
        for (weight[1] = 10; weight[1] <= 50; weight[1] += 10)
        {
            for (weight[2] = 10; weight[2] <= 50; weight[2] += 10)
            {
                weight[3] = weight[0] + weight[1] - weight [2];
                if (weight[0] + weight[3] > weight[1] + weight[2]
                    && weight[0] + weight[2] < weight[1])
                    {
                        for (int i = 0; i < 4; i++)
                        {
                            for (int j = 0; j < 3 - i; j++)
                            {
                                if (weight[j] < weight[j + 1])
                                {
                                    temp = weight[j + 1];
                                    weight[j + 1] = weight[j];
                                    weight[j] = temp;
                                    temp1 = a[j + 1];
                                    a[j + 1] = a[j];
                                    a[j] = temp1;
                                }
                            }
                        }
                        for (int i = 0; i < 4; i++)
                        {
                            cout << a[i] << " " << weight[i] << endl;
                        }
                    }
            }
        }
    }
    return 0;
}
int main()
{
 int z,q,s,l,i,check;//????
 char a[6];
 for(z=1;z<=5;z++)   //????
	 for(q=1;q<=5;q++) 
		 for(s=1;s<=5;s++) 
		   for(l=1;l<=5;l++)
		   {check=(z+q==s+l)+(z+l>s+q)+(z+s<q);
               if(check==3)
			   {a[z]='z';a[q]='q';a[s]='s';a[l]='l'; //????
			   for(i=5;i>=1;i--)
				   if(i==z||i==q||i==s||i==l)
			   cout<<a[i]<<" "<<i*10<<endl;}
            }
 
	
	return 0;
	
}
int main()
{ 
int z,q,s,l;


for(z=1;z<=5;z++)
for(q=1;q<=5;q++)
for(s=1;s<=5;s++)
{
l=z+q-s;
if((l>=1)&&(l<=5)&&(z+l>s+q)&&(z+s<q)&&(z!=q)&&(z!=s)&&(z!=l)&&(q!=s)&&(q!=l)&&(s!=l))
{
cout << 'l' <<" "<<l*10<<endl;

cout << 'q' <<" "<<q*10<<endl;

cout << 'z' <<" "<<z*10<<endl;
cout << 's' <<" "<<s*10<<endl;
}





}
}
int main()
{
    int i, j, t;
    char m;
    int weight[4];
    char name[5] = {"zqsl"};
    for ( weight[0] = 1; weight[0] <= 5 ;weight[0]++ )
        for ( weight[1] = 1; weight[1] <= 5 ;weight[1]++ )
            for ( weight[2] = 1; weight[2] <= 5 ;weight[2]++ )
                for ( weight[3] = 1; weight[3] <= 5 ;weight[3]++ )
                    if (  (weight[3] != weight[1]) && (weight[3] != weight[0]) && 
                          (weight[3] != weight[2]) && (weight[1] != weight[0]) && (weight[2] != 
                          weight[1]) && (weight[2] != weight[0]))
                             if ((weight[0] + weight[1]) == (weight[2] + weight[3]))
                                if ((weight[0] + weight[3]) > (weight[2] + weight[1]))
                                   if ( (weight[0] + weight[2]) < weight[1] )
                                   {
                                      for ( i = 0; i < 3; i++ )
                                          for ( j = i + 1; j < 4; j++ )
                                              if ( weight[i] < weight[j] )
                                              {
                                                   t = weight[i];
                                                   weight[i] = weight[j];
                                                   weight[j] = t;
                                                   m = name[i];
                                                   name[i] = name[j];
                                                   name[j] = m;
                                              }
                                      for ( i = 0; i < 4; i++ )
                                          cout << name[i] << " " << weight[i] * 10 << endl;
                                   }
    return 0;
}
int main()//?????
{
	int z,q,s,l,i;
	char r[6]={'\0'};
	for(z=1;z<=5;z++)
		for(q=1;q<=5;q++)
			for(s=1;s<=5;s++)
				for(l=1;l<=5;l++)
				{
					if(z==q||z==s||z==l||q==s||q==l||s==l)continue;
					if(z+q==s+l&&z+l>s+q&&z+s<q)
					{
						r[z]='z';
						r[q]='q';
						r[s]='s';
						r[l]='l';
						for(i=5;i>0;i--)
							if(r[i]!='\0')
								cout<<r[i]<<" "<<i*10<<endl;
					}

				}
	return 0;
}//?????
int main()
{
    int z,q,s,l;
    int a[4],i,j,k;
    char b[4],h;                   //k,h??????i,j????? 
    for(z=1;z<=5;z++)
     for(q=1;q<=5;q++)
      for(s=1;s<=5;s++)
       for(l=1;l<=5;l++)           //?????????? 
        if((z+q)==(s+l)&&(z+l)>(s+q)&&(z+s)<q)  //???????? 
        {
         a[0]=z*10; b[0]='z';
         a[1]=q*10; b[1]='q';
         a[2]=s*10; b[2]='s';
         a[3]=l*10; b[3]='l';
        }                          //??????????????? 
    for(i=0;i<3;i++)
     for(j=0;j<3-i;j++)
      if(a[j]<a[j+1])
       {k=a[j];
        a[j]=a[j+1];
        a[j+1]=k;
        h=b[j];
        b[j]=b[j+1];
        b[j+1]=h;
       }                        //????????????????????? 
  for(i=0;i<4;i++)
  cout<<b[i]<<" "<<a[i]<<endl;  //?? 
  return 0; 
}
//***************************************************
//* ???: ???                                  *
//* ????????????????                *
//* ??????                                    *
//* ?? ?2010?11?20?                           *
//***************************************************
int main()
{
	char name[4] = {'z', 'q', 's', 'l'};                        //??????????????????? 
	int weight[4];                                              //??????????????
	int i, j;
	for (weight[0] = 1; weight[0] <= 5; weight[0] ++)
		for (weight[1] = 1; weight[1] <= 5; weight[1] ++)
			for (weight[2] = 1; weight[2] <= 5; weight[2] ++)
				for (weight[3] = 1; weight[3] <= 5; weight[3] ++)           //??????????????????
				{
					if (weight[0] + weight[1] == weight[3] + weight[2] && weight[0] + weight[3] > weight[1] + weight[2] 
						&& weight[0] + weight[2] < weight[1])             //??????
					{
						for (j = 5; j >= 1; j --)
							for (i = 0; i < 4; i ++)                    //????????? ???????50???10
							{
								if(weight[i] == j)                   
									cout << name[i] << ' ' << j * 10 << endl;     //???????????
							}
					}
				}
     return 0;
}
int main()
{
	int i,z,q,s,l,a[51]={0};
	for(i=10;i<=50;i=i+50) a[i]=i;
	for(z=10;z<=50;z=z+10)
	{	for(q=10;q<=50;q=q+10)
	    {   if(z!=q)
	       {  for(s=10;s<=50;s=s+10)
		     {   if(z!=s&&s!=q)
	            { for(l=10;l<=50;l=l+10)		  
			       { if(l!=z&&l!=q&&l!=s)
				     { if((z+q==s+l)&&(z+l>s+q)&&(z+s<q))
				       {
				       for(i=50;i>=10;i=i-10)
					   { if(a[i]!=0)
					   { if(a[i]=l) cout<<"l"<<" "<<l<<endl;
					     if(a[i]=q) cout<<"q"<<" "<<q<<endl; 
				     	 if(a[i]=z) cout<<"z"<<" "<<z<<endl;
					     if(a[i]=s) cout<<"s"<<" "<<s<<endl; 
						
					    
						
					  
					   
					   }}}}}}}}}}


	return 0;
}
/*
 * weight.cpp
 *???
 *  Created on: 2012-11-5
 *      Author: ???
 */
int main() {
	int z, q, s, l, a, b, c, d, i, j, w[4];               //???????????
	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;
					w[1] = ((a + b) == (c + d));
					w[2] = ((a + d) > (c + b));
					w[3] = ((a + c) < b);
					if ((w[1] + w[2] + w[3]) == 3) {       //??????????????????
						z = a * 10;
						q = b * 10;
						s = c * 10;
						l = d * 10;
						break;
					}
				}
			}
		}
	}
	char rank[5] = { 'z', 'q', 's', 'l' }, temp1;           //????????
	int m[5] = { z, q, s, l }, temp2;
	for (j = 0; j < 3; j++)
		for (i = 0; i <= (2 - j); i++) {
			if (m[i] < m[i + 1]) {                          //????????????????????
				temp1 = rank[i];
				rank[i] = rank[i + 1];
				rank[i + 1] = temp1;
				temp2 = m[i];
				m[i] = m[i + 1];
				m[i + 1] = temp2;
			}
		}

	for (i = 0; i < 4; i++) {                                //??????????
		cout << rank[i] << ' ' << m[i] << endl;
	}
	return 0;
}
int main()
{
	int z,q,s,l,a[100],c[100],i,j,t1,t2;
	char b[5];
	for (z=1;z<=5;z++)
	{
		for (q=1;q<=5;q++)
			for (s=1;s<=5;s++)
				for (l=1;l<=5;l++)
				{
					if ((z+q==s+l)+((z+l)>(s+q))+((z+s)<q)+(z!=q)+(z!=s)+(z!=l)+(q!=s)+(q!=l)+(s!=l)==9)
					{
						a[0]=z,b[0]='z',c[0]=0;
						a[1]=q,b[1]='q',c[1]=1;
						a[2]=s,b[2]='s',c[2]=2;
						a[3]=l,b[3]='l',c[3]=3;
					}
				}
	}
	for (i=0;i<4;i++)
	{
		for (j=0;j<4-i;j++)
			if(a[j]<a[j+1])
			{
				t1=a[j];a[j]=a[j+1];a[j+1]=t1;
				t2=c[j];c[j]=c[j+1];c[j+1]=t2;

			}
	}
	for (i=0;i<4;i++)
		cout<<b[c[i]]<<" "<<a[i]<<0<<endl;
		
	return 0;
}
void sort(int a,int b,int c,int d)
{
	int result[4]={a,b,c,d};
	char name[4]={'z','q','s','l'};
	int temp;
	char tempname;
	for(int i=0;i<4;i++)
	{
		for(int j=i;j<4;j++)
		{
			if(result[i]<result[j])
			{
				temp=result[i];
				result[i]=result[j];
				result[j]=temp;
				
				tempname=name[i];
				name[i]=name[j];
				name[j]=tempname;			
			}
		}
	}
	
	for(int i=0;i<4;i++)
	{
		cout<<name[i]<<" "<<result[i]*10<<endl;
	}
} 

int main()
{
	int z,q,s,l;
	for(z=1;z<=5;z++)
	{
		for(q=1;q<=5;q++)
		{
			for(s=1;s<=5;s++)
			{
				for(l=1;l<=5;l++)
				{	
					if(z+q==s+l&&z+l>s+q&&z+s<q&&z!=q!=s!=l)
					{
						sort(z,q,s,l);
					}
				}
			}
		}
	}
		return 0;
}