semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a[4], i, d, j, l,f[4]={0};
	char c[5] = {"zqsl"}; 
	for(a[0] = 1;a[0] <= 3;a[0]++)
		for(a[1] = 4;a[1] <= 5;a[1]++)
			for(a[2] = 1;a[2] <= 3;a[2]++)
				if(a[2] != a[0])
					for(a[3] = 1;a[3] <=5;a[3]++)
						if((a[0] + a[1] == a[2] + a[3]) && (a[0] + a[3] > a[2] + a[1]) && (a[0] + a[2] < a[1]) && (a[3] != a[0])&&(a[3] != a[1])&&(a[3] != a[2]))
						{
							for(i = 0;i <4;i++)
							{
								d = 0;
								for(j = 0;j < 4;j++)
								{
									if(d < a[j]&&f[j]==0) 
									{d = a[j];
									l = j;
								}
							
							}
								f[l]=1;
								cout << c[l] <<" "<< 10 * a[l] <<endl;
							}
						}

	return 0;
}
/*
 * ???.cpp
 *
 *  Created on: 2012-10-16
 *      Author: ???
 */
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)//????
					{
						if(l > q)
						{
							cout << "l" <<" " << 10*l <<endl;
							cout << "q" <<" " <<10*q <<endl;//???????
						}
						if(z>s)
						{
							cout << "z" <<" " << 10*z <<endl;
							cout << "s" <<" " << 10*s <<endl;
						}
						else
						{
							cout << "s" <<" " << 10*s <<endl;
							cout << "z" <<" " << 10*z <<endl;//?????????
						}
					}
				}

	return 0;
}
main()
{
int a[4]={0};
char b[4]={0};
int zi,qi,si,li,i;
int z,q,s,l;

for(a[0] = 10;a[0]<51;a[0]=a[0]+10)
for(a[1] = a[0]+10;a[1]<51;a[1]=a[1]+10)
for(a[2] = a[1]+10;a[2]<51;a[2]=a[2]+10)
for(a[3] = a[2]+10;a[3]<51;a[3]=a[3]+10)
{
for(zi=0;zi<4;zi++)
for(qi=0;qi<4;qi++)
for(si=0;si<4;si++)
for(li=0;li<4;li++)
{
if( (a[zi]+a[qi])==(a[si]+a[li]) && a[zi]+a[li]>a[si]+a[qi] && a[zi]+a[si]<a[qi] )
{
b[zi]='z';
b[qi]='q';
b[si]='s';
b[li]='l';

for(i=3;i>=0;i--)
{
printf("%c %d\n",b[i],a[i]);
}

}

}


}



}
int main()
{
	int a[4], ta, i, j;
	char name[4]={'z', 'q', 's', 'l'}, tn;
	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] ++ )
					if ( a[0] != a[1] && a[0] != a[2] && a[0] != a[3] && a[1] != a[2] && a[1] != a[3] && a[2] != a[3] 
						&& ((a[0] + a[1]) == (a[2] + a[3])) && ((a[0] + a[3]) > (a[1] + a[2])) && ((a[0] + a[2]) < a[1]))
					{
						for ( i = 0; i < 3; i ++)
							for ( j = 0; j < 3 - i; j ++ )
								if ( a[j] < a[j + 1] )
								{
									ta = a[j];
									a[j] = a[j + 1];
									a[j + 1] = ta;
									tn = name[j];
									name[j] = name[j + 1];
									name[j + 1] = tn;
								}
							for ( i = 0; i < 4; i ++ )
								cout << name[i] << " " << a[i] <<"0"<< endl;
					}

	return 0;
}
//************************************************************************
//??????
//?????????
//??????
//************************************************************************
int main()
{
	int mZ,mQ, mS, mL, c, sum, m[4];
	char name[4] = {'z', 'q', 's', 'l'}, n;
	for(mZ = 10; mZ <= 50; mZ = mZ +10)
		for(mQ = 10; mQ <= 50; mQ = mQ +10)
			for(mS = 10; mS <= 50; mS = mS + 10)
				for(mL = 10; mL <= 50; mL = mL +10)
				{
					sum = (mZ + mQ == mS + mL) +(mZ + mL > mS + mQ) + (mZ + mS < mQ);
					if(sum == 3)
					{
						m[0] = mZ;
						m[1] = mQ;
						m[2] = mS;
						m[3] = mL;
					}
				}
	for(int j = 0; j < 3; j++)
	{
	   for(int i = 0; i < 3; i++)
	   {
		   if(m[i] < m[i+1])
		   {
			   c = m[i+1];
			   n = name[i+1]; 
			   m[i+1] = m[i];
			   name[i+1] = name[i];
			   m[i] = c;
			   name[i] = n;
		   }
	   }
	}
	cout<<name[0]<<" "<<m[0]<<endl;
	cout<<name[1]<<" "<<m[1]<<endl;
	cout<<name[2]<<" "<<m[2]<<endl;
	cout<<name[3]<<" "<<m[3]<<endl;
	return 0;
}
void main()
{
	char name[4]={'z','q','s','l'};
	int w[4],i,j,p=1,r=0;
	
	for(w[0]=10;w[0]<=50;w[0]+=10){
		for(w[1]=10;w[1]<=50;w[1]+=10){
			for(w[2]=10;w[2]<=50;w[2]+=10){
				for(w[3]=10;w[3]<=50;w[3]+=10){
				if(!(w[0]==w[1]||w[0]==w[2]||w[0]==w[3]||w[1]==w[2]||w[1]==w[3]||w[2]==w[3])&&(w[0]+w[1]==w[2]+w[3])&&(w[0]+w[3]>w[2]+w[1])&&(w[0]+w[2]<w[1])) goto end;
				}
			}
		}
	}
end:;
	while(r<4){
		for(i=0;i<4;i++){
			for(j=0;j<4;j++){
				if(w[i]==w[j])
					continue;
				if(w[i]<w[j]){
					p=0;
					break;
				}
			}
			if(p==1){
				printf("%c %d\n",name[i],w[i]);
				w[i]=0;
				r++;
				break;
			}
			else p=1;
		}
	}
	
}
int main()
{
	int z, q, s, l, i;
	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)
						goto loop; 
	loop:
	cout << "l " << 10 * l << '\n';
	cout << "q " << 10 * q << '\n';
	cout << "z " << 10 * z << '\n';
	cout << "s " << 10 * s << endl;
	return 0;
}
//???????
//??????
//?????2010-11-20
//???????????????????????????????


int main()
{
	int z,q,s,l,a[5],t,i,j;//a????????10KG?
	char n[5]={'0','z','q','s','l'},tt;//n????
	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[1]=z;a[2]=q;a[3]=s;a[4]=l;
						        for (i=1;i<=4;i++)//??
						        	for (j=i+1;j<=4;j++)
						        		if (a[i]<a[j])
						        		{
						        			t=a[i];
						        			a[i]=a[j];
						        			a[j]=t;
						        			tt=n[i];
						        			n[i]=n[j];
						        			n[j]=tt;
						        		}
						        break;
							}
	for (i=1;i<=3;i++) cout<<n[i]<<" "<<a[i]<<0<<endl;//??
	cout<<n[4]<<" "<<a[4]<<0;
	return 0;
}
int main()
{
	int z,q,s,l,e=0,a,b,c,d;
	for(q=3;q<=5;q++)
	{
		for(z=1;z<=5;z++)
		{
			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&&(z+q)==(s+l)&&(z+l)>(s+q)&&(z+s)<q) 
					{e=1; break;}
				}
				if(e==1) break;
			}
			if(e==1) break;
		}
		if(e==1) break;
	}
	z*=10;
	q*=10;
	s*=10;
	l*=10;
	if(q>l) 
	{
		cout<<"q "<<q<<endl;
		if(l>z&&l>s) 
		{
			cout<<"l "<<l<<endl;
			if(z>s)
				cout<<"z "<<z<<endl<<"s "<<s<<endl;
			else cout<<"s "<<s<<endl<<"z "<<z<<endl;
		}
		else if(z>l&&z>s) 
		{
			cout<<"z "<<z<<endl;
			if(l>s)
				cout<<"l "<<l<<endl<<"s "<<s<<endl;
			else cout<<"s "<<s<<endl<<"l "<<l<<endl;
		}
		else if(s>l&&s>z) 
		{
			cout<<"s "<<s<<endl;
			if(l>z)
				cout<<"l "<<l<<endl<<"z "<<z<<endl;
			else cout<<"z "<<z<<endl<<"l "<<l<<endl;
		}
	}
	else
		{
		cout<<"l "<<l<<endl;
		if(q>z&&q>s) 
		{
			cout<<"q "<<q<<endl;
			if(z>s)
				cout<<"z "<<z<<endl<<"s "<<s<<endl;
			else cout<<"s "<<s<<endl<<"z "<<z<<endl;
		}
		else if(z>q&&z>s) 
		{
			cout<<"z "<<z<<endl;
			if(q>s)
				cout<<"q "<<q<<endl<<"s "<<s<<endl;
			else cout<<"s "<<s<<endl<<"q "<<q<<endl;
		}
		else if(s>q&&s>z) 
		{
			cout<<"s "<<s<<endl;
			if(q>z)
				cout<<"q "<<q<<endl<<"z "<<z<<endl;
			else cout<<"z "<<z<<endl<<"q "<<q<<endl;
		}
	}
	return 0;
}
/*
 * 05.cpp
 *??????
 *  Created on: 2012-10-18
 *      Author: ???
 */
int main()
{
	int l,q,z,s;//????
	s=10;z=20;q=30;l=40;//??????
	if(z+q==s+l&&z+l>s+q&&z+s<q)
		cout<<"l 40\n"<<"q 30\n"<<"z 20\n"<<"s 10\n";//????
	s=10;z=20;q=40;l=50;//??????
	if(z+q==s+l&&z+l>s+q&&z+s<q)
		cout<<"l 50\n"<<"q 40\n"<<"z 20\n"<<"s 10\n";//????
	return 0;
}
// ??3.cpp : Defines the entry point for the console application.
//


int main()
{
	int z = 0;
	int q = 0;
	int s = 0;
	int l = 0;
	int i = 0;
	char temp[51];

	memset(temp,'0',sizeof(temp));

	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) == (s + l)
						&& (z + l) > (s + q)
						&& (z + s) < q )
					{
						temp[z] = 'z';
						temp[s] = 's';
						temp[q] = 'q';
						temp[l] = 'l';

					for( i = 50;i >= 10; i--)
					{
						if( temp[i] != '0' )
						{
							cout << temp[i] << " " << i << endl;
						}
					}
					}
				}



	return 0;

}
//*********************************************
//*            ????????               *
//*             ??????                  *
//*            ???1200012764               *
//*           ???2012/10/12                *  
//*********************************************
int main ()
{
	int z=1, q=1, s=1, l=1 ;                       //???????????10?????
	int zx , qx , sx , lx ;                     //??????????????10?????
	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 ))
					{
						zx = z ;
						qx = q ;
						sx = s ;
						lx = l ;
					}
				}
				int weight[5] = { 0, zx, qx, sx, lx } ;                   //??????????????
				char mweight[5] = { '0' ,'z' ,'q' ,'s', 'l' } ;           //?????????????z q s l
				for ( int k = 1 ; k <= 4 ; k++ )
				{
					for ( int r = 1 ; r <= 4 - k ; r++ )                //????????????
					{
						if ( weight[r] < weight[r+1] )
						{
							int p = weight[r] ;
							weight[r] = weight[r+1];
							weight[r+1] = p ; 
							char q = mweight[r] ;
							mweight[r] = mweight[r+1];
							mweight[r+1] = q ;
						}
					}
				}
				cout << mweight[1] << " " << weight[1]*10 << endl ;          //??????????????
				cout << mweight[2] << " " << weight[2]*10 << endl ;
				cout << mweight[3] << " " << weight[3]*10 << endl ;
				cout << mweight[4] << " " << weight[4]*10 << endl ;
				return 0 ;
}
int main()
{
	int z, q, s, l, z1, q1, s1, l1;
	char Z = 'z';
	char Q = 'q';
	char S = 's';
	char L = 'l';
	int max1, max2, min1, min2, n1, n2, n3, n4;
	char MAX1, MAX2, MIN1, MIN2, N1, N2, N3, N4;
	
	for(z1 = 10; z1 <= 50; z1 = z1 + 10)
	{
		for(q1 = 10; q1 <= 50; q1 = q1 +10)
		{
			for(s1 = 10; s1 <= 50; s1 = s1 + 10)
			{
				for(l1 = 10; l1 <= 50; l1 =l1 + 10)
				{
					if((z1 + q1 == s1 + l1)  && (z1 + l1 >= s1 + q1) && (z1 + s1 < q1) && (z1 != q1) 
						&& (z1 != s1) && (z1 != l1) && (q1 != s1) && (q1 != l1) && (s1 != l1))
					{
						z = z1;
						q = q1;
						s = s1;
						l = l1;
					}
				}
			}
		}
	}
	
	if (z > q)
	{
		max1 = z;
		MAX1 = 'z';
		min1 = q;
		MIN1 = 'q';
	}
	else
	{	
		max1 = q;
		MAX1 = 'q';
		min1 = z;
		MIN1 = 'z';
	}
	if(s > l)
	{
		max2 = s;
		MAX2 = 's';
		min2 = l;
		MIN2= 'l';
	}
	else
	{
		max2 = l;
		MAX2 = 'l';
		min2 = s;
		MIN2= 's';
	}
	
	if(max1 > max2)
	{
		n1 = max1;
		N1 = MAX1;
		n2 = max2;
		N2 = MAX2;
	}
	else
	{
		n1 = max2;
		N1 = MAX2;
		n2 = max1;
		N2 = MAX1;
	}
	if(min1 < min2)
	{
		n4 = min1;
		N4 = MIN1;
		n3 = min2;
		N3 = MIN2;
	}
	else
	{
		n4 = min2;
		N4 = MIN2;
		n3 = min1;
		N3 = MIN1;
	}
	cout<<N1<<" "<<n1<<endl;
	cout<<N2<<" "<<n2<<endl;
	cout<<N3<<" "<<n3<<endl;
	cout<<N4<<" "<<n4<<endl;
	return 0;
}
int main()
{
    char sn[4]={'z','q','s','l'};                                               //??sn[4]????? 
    int wt[4],rk[4],w=0;
    //??w???????????????wt[4]??????1/10???rk[4]????????rk[n]?????wt[i]?sn[i]?????????????????? 
    for(int i=0;i<4;i++)rk[i]=i;                                                //??rk[4]??????wt[n]?sn[n]????? 
    for(wt[0]=1;wt[0]<=5;wt[0]++)                                               //???A??wt[0]?wt[3]?????? 
    {
        for(wt[1]=1;wt[1]<=5;wt[1]++)
        {
            for(wt[2]=1;wt[2]<=5;wt[2]++)
            {
                for(wt[3]=1;wt[3]<=5;wt[3]++)
                {
                    if(wt[0]+wt[1]==wt[2]+wt[3]&&wt[0]+wt[3]>wt[1]+wt[2]&&wt[0]+wt[2]<wt[1])
                    {
                        int t;
                        w=1;
                        for(int i=0;i<4;i++)                                    //???B????sn[4]?wt[4]?????????????????? 
                        {
                            for(int j=0;j<4;j++)
                            {
                                if(wt[rk[j]]<wt[rk[j+1]])
                                {
                                    t=rk[j];
                                    rk[j]=rk[j+1];
                                    rk[j+1]=t;
                                }
                            }
                        }                                                       //???B?? 
                        break;
                    }
                }
                if(w==1)break;                                                  //????w=1?????????????????????goto??? 
            }
            if(w==1)break;
        }
        if(w==1)break;
    }                                                                           //???A?? 
    for(int i=0;i<4;i++)cout<<sn[rk[i]]<<' '<<10*wt[rk[i]]<<endl;
    return 0;
}
int main()
{
    int z,q,s,l;
    char a[6]={'0','0','0','0','0','0'};           //??????
    for(z=1;z<=5;z++)   //?1234??10 20 30 40
         for(q=1;q<=5;q++)
              if(z==q)continue;
              else for(s=1;s<=5;s++)
                  if(z==s||q==s)continue;
                  else for(l=1;l<=5;l++)
                                           //?? ???
                         if(((z+q)==(s+l))&&((z+l)>(s+q))&&(z+s<q))
                             {a[z]='z';
                              a[q]='q';
                              a[s]='s';
                              a[l]='l';
                              for(int i=5;i>=1;i--)
                                   if(a[i]!='0')
                                      cout<<a[i]<<" "<<i*10<<endl;}
    return 0;
}
/*????????????????????????; ???????????????
????????????????????????????*/
void main()
{
	int i,j,w[4],t;
	char n[4]={'z','q','s','l'},c;
	for (w[0]=1;w[0]<6;w[0]++)
	{
	  for (w[1]=1;w[1]<6;w[1]++)
	  {
	  	if (w[0]==w[1]) continue;
	  	for (w[2]=1;w[2]<6;w[2]++)
	  	{
	  		if (w[0]==w[2]||w[1]==w[2]) continue;
	  		for (w[3]=1;w[3]<6;w[3]++)
	  		{
	  			if (w[0]==w[3]||w[1]==w[3]||w[2]==w[3]) continue;
	  			if ((w[0]+w[3]>w[2]+w[1])&&w[0]+w[1]==w[2]+w[3]&&w[0]+w[2]<w[1])
	  			{
	  				for (i=0;i<4;i++)
	  				for (j=0;j<3-i;j++)
	  				  if (w[j]<w[j+1]){t=w[j];w[j]=w[j+1];w[j+1]=t;c=n[j];n[j]=n[j+1];n[j+1]=c;}
 				    for (i=0;i<4;i++) printf("%c %d0\n",n[i],w[i]);
 				    exit(1);
	  			}
	  		}
	  	}
	  }
	}
}
int main()
{ char a[10];
  int z,q,s,l,i,j,k,t;
  for (i=1;i<=5;i++)
       a[i] =' ';
  for (z=1;z<=5;z++)
       for (q=1;q<=5;q++)
            { if (z==q) continue ;
              for (s=1;s<=5;s++)
                   { if ((s==q)||(s==z)) continue ;
                    for (l=1;l<=5;l++) 
                     {if ((l==z)||(l==q)||(l==s)) continue;
                     if ((z+q==s+l)&&(z+l>s+q)&&(z+s<q)) 
                         {a[z]='z';
                          a[q]='q';
                          a[s]='s';
                          a[l]='l';
                          for (i=5;i>=1;i--)
                               if (a[i]!=' ') 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++)
			{
				for(l = 1; l <=5; l++)
				{
					if ((z + q == s + l)&&(z + l > s + q)&&(z + s < q))
					{
						cout << "l" << " " << l * 10 << endl;
						cout << "q" << " " << q*10 << endl;
						cout << "z" << " " << z*10 <<endl;
						cout << "s" << " " << s*10 << endl;
						
					}
				}
			}
		}
	}
	return 0;
}
// It's an ugly program
// solving a **** problem
int main()
{
	int w[4] = {0};
	char name[4] = {'z','q','s','l'};
	for(w[0] = 1; w[0] <= 5; w[0] ++)
		for(w[1] = 1; w[1] <= 5; w[1] ++) if(w[1] != w[0]) 
			for(w[2] = 1; w[2] <= 5; w[2] ++) if((w[2] != w[1]) && w[2] != w[0])
				for(w[3] = 1; w[3] <= 5; w[3] ++) if((w[3] != w[2]) && (w[3] != w[1]) && (w[3] != w[0]))
				{
					if((w[0] + w[1] == w[2] + w[3]) && (w[0] + w[3] > w[1] + w[2]) && (w[0] + w[2] < w[1]))
					{
						for(int k = 5; k > 0; k --)
							for(int i = 0; i < 4; i ++) if(w[i] == k)
								cout << name[i] << ' ' << w[i] * 10 << endl;
						return 0;
					}
				}
}
int a[4],b[6];
const char c[4]={'z','q','s','l'};
int main() {
	int i = 1, j = 1, k = 1, m = 1;  //????
	int z, q, s, l, sum1, sum2, sum3;//????
	for (i = 1; i <= 5; i++) //???????
		for (j = 1; j <= 5; j++)
			for (k = 1; k <= 5; k++)
				for (m = 1; m <= 5; m++)
					if (i != j && i != m && i != k && j != k && j != m && m
							!= k) {   //???????????
						a[0]= z = 10 * i; //????
						a[1]= q = 10 * j;//????
						a[2]= s = 10 * k;//????
						a[3]= l = 10 * m;//????
						sum1 = ((z + q) == (s + l));
						sum2 = ((z + l) > (s + q));
						sum3 = ((z + s) < q);
						if (sum1 == 1 && sum2 == 1 && sum3 == 1) { //???????????
							memset(b,-1,sizeof(b));
							for(int l=0;l<4;l++)
							{
								b[a[l]]=l;
							}
							for(int l=5;l>0;l--)
							{
								if (b[l]>-1)
								{
									cout<<c[b[l]]<<' '<<l*10<<endl;
								}
							}
							if (q > l) {//??????
								if (z > s)//?????????

								{
									cout << "q" << " " << q << endl;
									cout << "l" << " " << l << endl;
									cout << "z" << " " << z << endl;
									cout << "s" << " " << s << endl;
								} else {                 //?????????
									cout << "q" << " " << q << endl;
									cout << "l" << " " << l << endl;
									cout << "s" << " " << s << endl;
									cout << "z" << " " << z << endl;
								}
							}

							if (q < l) {   //??????
								if (z > s) {//?????????
								}
								cout << "l" << " " << l << endl;
								cout << "q" << " " << q << endl;
								cout << "z" << " " << z << endl;
								cout << "s" << " " << s << endl;
							} else {//?????????
								cout << "l" << " " << l << endl;
								cout << "q" << " " << q << endl;
								cout << "s" << " " << s << endl;
								cout << "z" << " " << z << endl;
							}
						}
					}
	return 0;
}
//*****************
//???***********
int main()
{
       int z=1,q=1,s=1,l=1,Z=1,Q=1,S=1,L=1;
	   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) )
					      {
						   Z=z*10;Q=q*10;S=s*10;L=l*10;
					      } 
				   }
							for(int i=50;i>=10;i=i-10)
						   {
							   if(Z==i)
								   cout<<'z'<<' '<<Z<<endl;
							   if(Q==i)
								   cout<<'q'<<' '<<Q<<endl;
							   if(S==i)
								   cout<<'s'<<' '<<S<<endl;
							   if(L==i)
								   cout<<'l'<<' '<<L<<endl;
							}
						   return 0;
}
void 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==s+l&&z+l>s+q&&q>z+s)
    {
        int a[4]={z,q,s,l},i,j,t;
        for(i=0;i<3;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;
        }
        for(i=0;i<4;i++)
        {
            if(a[i]==z)printf("z %d\n",z);
            if(a[i]==q)printf("q %d\n",q);
            if(a[i]==s)printf("s %d\n",s);
            if(a[i]==l)printf("l %d\n",l);
        }
    }
}
int main() {
	int z, q, s, l;
	for (z = 1; z < 6; ++z) {						// ???????? 
		for (q = 1; q < 6; ++q) {					// ???????? 
			for (s = 1; s < 6; ++s) {				// ???????? 
				for (l = 1; l < 6; ++l) {			// ???????? 
					if (z + q != s + l) continue;	// ?????????? 
					if (z + l <= s + q) continue;
					if (z + s >= q) continue;
					printf("l %d\nq %d\nz %d\ns %d\n", l*10, q*10, z*10, s*10);
				}
			}
		}
	}
	return 0;
}
/*
 *??? weight.cpp
 *????: 2012-10-26
 */
int main()
{
	int z,q,s,l,p,i,j;  //????
	char b[4]={'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))//????
					{
						int a[4]={z,q,s,l};//??????
						for (j=2;j<=4;j++) //??????
							{
								for(i=0;i<=4-j;i++)
								{
									if(a[i]<a[i+1])
									{
										p=a[i];
										a[i]=a[i+1];
										a[i+1]=p;
										p=b[i];
										b[i]=b[i+1];
										b[i+1]=p;//??????????
									}
								}
							}
						for(i=0;i<=3;i++)//??????
						{
							cout<<b[i]<<" "<<10*a[i]<<endl;
						}
					}
				}
	return 0;
}
int main()
{
  cout<<"l 50"<<endl;
  cout<<endl;
  cout<<"q 40"<<endl;
  cout<<endl;
  cout<<"z 20"<<endl;
  cout<<endl;
  cout<<"s 10"<<endl;
  return 0;
}
/*
 *????pro30.cpp
 *??????
 *?????2012-10-10
 *??????
 */



int main()
{
    int z,q,s,l,zz,qq,ss,ll;
    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==s+l && z+l>s+q && z+s<q) // ??
                    {
                        zz=(z<q)+(z<s)+(z<l); // ????
                        qq=(q<z)+(q<s)+(q<l);
                        ss=(s<z)+(s<q)+(s<l);
                        ll=(l<z)+(l<q)+(l<s);
                        if (zz==0) cout << "z " << z << endl;
                        if (qq==0) cout << "q " << q << endl;
                        if (ss==0) cout << "s " << s << endl;
                        if (ll==0) cout << "l " << l << endl;
                        if (zz==1) cout << "z " << z << endl;
                        if (qq==1) cout << "q " << q << endl;
                        if (ss==1) cout << "s " << s << endl;
                        if (ll==1) cout << "l " << l << endl;
                        if (zz==2) cout << "z " << z << endl;
                        if (qq==2) cout << "q " << q << endl;
                        if (ss==2) cout << "s " << s << endl;
                        if (ll==2) cout << "l " << l << endl;
                        if (zz==3) cout << "z " << z << endl;
                        if (qq==3) cout << "q " << q << endl;
                        if (ss==3) cout << "s " << s << endl;
                        if (ll==3) cout << "l " << l << endl;
                    }
    return 0;
}
int main()
{
	cout<<"l "<<50<<"\n";
	cout<<"q "<<40<<"\n";
	cout<<"z "<<20<<"\n";
	cout<<"s "<<10<<"\n";
	
}
int main()
{
int a[4],x;
char b[4]={'z','q','s','l'},y;
for(int i=3;i<10;i++)
{
   for (a[0]=1;a[0]<=5;a[0]++)
      {
      a[1]=i-a[0];
      if (a[0]==a[1]) continue;
      for (a[2]=1;a[2]<=5;a[2]++)
         {a[3]=i-a[2]; if(a[3]==a[1]||a[3]==a[0]) continue;
      if (a[0]+a[3]>a[1]+a[2]&&a[0]+a[2]<a[1]) goto T;}
      }
}
T:
for (int j=2;j>=0;j--)
   for (int k=0;k<=j;k++)
      if (a[k]<a[k+1])
      {
      x=a[k];     y=b[k];
      a[k]=a[k+1];b[k]=b[k+1];
      a[k+1]=x;   b[k+1]=y;
      } 
for (int l=0;l<4;l++)
   printf("%c %d\n",b[l],a[l]*10);
}
/*
 *  ???.cpp
 *
 *  Created on: 2010-11-20
 *      Author: jsgl
 */
int main()
{
   int z,q,s,l,i;

   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&&z!=s&&z!=l&&q!=s&&q!=l&&s!=l)
				   {
					   if ((z+q==s+l)&&(z+l>s+q)&&(z+s<q))
					   {
						  for (i=50;i>=10;i=i-10)
                       {if (z==i)  cout<<'z'<<' '<<z<<endl;
					   if (q==i)  cout<<'q'<<' '<<q<<endl;
					   if (s==i)  cout<<'s'<<' '<<s<<endl;
					   if (l==i)  cout<<'l'<<' '<<l<<endl;}
					   }



				   }
   return 0;
}
int main()
{
	int a, b, c, d;
	for (a = 10; a <= 50; a += 10)
	{
		for (b = 10; b <= 50; b += 10)
		{
			if (a == b)
				continue;
			for (c = 10; c <= 50; c += 10)
			{
				d = a + b - c;
				if (d == a || d == b || d == c || d < 10 || d > 50 || a == c || b == c)
					continue;
				if (a + d > b + c && a + c < b)
					break;
			}
		    if (c != 60)
			break;
		}
		if (b != 60)
			break;
	}
	for (int i = 50; i >= 10; i -= 10)
	{
		if (a == i)
			cout << "z" <<' '<< a << endl;
		else
			if (b == i)
				cout << "q" <<' '<< b << endl;
			else
				if (c == i)
					cout << "s" <<' '<< c << endl;
				else
					if (d == i)
						cout << "l" <<' '<< d << endl;
	}
	return 0;
}
/*
 * chengtizhong.cpp
 *??????
 *  Created on: 2013-9-27
 *      Author: ???
 */
int main()
{
	for(int z=10;z<=50;z+=10)
		for(int q=10;q<=50;q+=10)
			for(int s=10;s<=50;s+=10)
			{
				int l=z+q-s;
				if((z+l>s+q)&&(z+s<q)&&(z!=q)&&(z!=s)&&(z!=l)&&(q!=s)&&(q!=l)&&(s!=l)&&(l>0)&&(l<=50))
				{
					for(int i=50;i>0;i-=10)
					{
						if(z==i)
							cout<<"z "<<z<<endl;
						if(q==i)
							cout<<"q "<<q<<endl;
						if(s==i)
							cout<<"s "<<s<<endl;
						if(l==i)
							cout<<"l "<<l<<endl;
					}
				}
			}
	return 0;
}