semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int z,q,s,l,pan[4],i,m;//q,z,s,l??????????pan????????
    char rank[60]; //rank??????
    for(z=10;z<=50;z=z+10)
    { 
       for(q=10;q<=50;q=q+10)
       { 
         if (z==q) continue;//?????? 
            for(s=10;s<=50;s=s+10)
            { 
               if ((z==s)||(q==s)) continue;
                  for(l=10;l<=50;l=l+10)
                    {
                                        if ((z==l)||(q==l)||(s==l)) continue;
                                        pan[1]=((z+q)==(s+l));
                                        pan[2]=((z+l)>(s+q));
                                        pan[3]=((z+s)<q);
                                        if (pan[1]+pan[2]+pan[3]==3)//????????3 
                                        {
                                              m=150-q-s-l-z;
                                              rank[z]='z';
                                              rank[q]='q';
                                              rank[s]='s';
                                              rank[l]='l';
                                        }
                    }
            }
       }
    }
     for(i=50;i>m;i=i-10) cout<<rank[i]<<" "<<i<<endl;
     for(i=m-10;i>=10;i=i-10) cout<<rank[i]<<" "<<i<<endl;
    return 0;
}
int main()
{
    int i,j,k,l,p=0,a[5],h;     //p???????????1 
    char b[5],c;
    for (i=1;i<6;i++)
    {
       for (j=1;j<6;j++)
       {
          if (j==i) continue;  //????????? 
          else
          {
              for (k=1;k<6;k++)
              {
                  if (k==j||k==i) continue; //????????? 
                  else
                  {
                    for (l=1;l<6;l++)
                    if (l!=i&&l!=j&&l!=k&&i+j==k+l&&
                    i+l>j+k&&i+k<j)
                    {
                                 p=1;
                                 break; //???????p??1????? 
                    }
                  }
                  if (p==1) break; //p??1?????
              }
          }
          if (p==1) break;  //p??1????? 
       }
       if (p==1) break;     //p??1????? 
    }     
    a[1]=i;
    a[2]=j;
    a[3]=k;
    a[4]=l;
    b[1]='z';
    b[2]='q';
    b[3]='s';
    b[4]='l';
    for (i=1;i<5;i++)
       for (j=i+1;j<5;j++)
          if (a[i]<a[j])
          {
                    h=a[i];
                    a[i]=a[j];
                    a[j]=h;
                    c=b[i];
                    b[i]=b[j];
                    b[j]=c;
          }    //?? 
    cout<<b[1]<<' '<<a[1]*10<<endl; 
    cout<<b[2]<<' '<<a[2]*10<<endl; 
    cout<<b[3]<<' '<<a[3]*10<<endl; 
    cout<<b[4]<<' '<<a[4]*10;        //??      
    return 0;
}
int main()
{


    int  cc1,cc2,cc3,cc4;
	char z, q, s, l;
	for(z=1;z<=4;z++)
		for(q=1;q<=4;q++)
			for(s=1;s<=4;s++)
				for(l=1;l<=4;l++)
					cc1=((q+z)==(s+l));
					cc2=((z+l)>(s+q));
				    cc3=((z+s)<q);
					cc4=(z!=s!=q!=l);
					if(cc2+cc3+cc4+cc1==4)
					
                   
					cout<<'l'<<' '<<50<<endl;
                     cout<<'l'<<' '<<50<<endl;

                    cout<<'q'<<' '<<40<<endl;
					
					cout<<'z'<<' '<<20<<endl;
                    cout<<'s'<<' '<<10<<endl;
					return 0;
}
int main()
{
 	int z,q,s,l,i,j,k;
 	int a[5]={0};
 	char b[5]={'d','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) )==0) 
					 {	a[1]=10*z;a[2]=10*q;a[3]=10*s;a[4]=10*l;
					   	 for (i=1;i<=3;i++)
			 	 		 {
						  	 for (j=4;j>i;j--)
							   {if  (a[j-1]<a[j]) 
							   		{
							   		a[0]=a[j-1];
							   		a[j-1]=a[j];
							   		a[j]=a[0];
							   		b[0]=b[j-1];
							   		b[j-1]=b[j];
							   		b[j]=b[0];
							   		
							   }		   	 
						
							   }
	   					 }
					 }
				
				}
			}
		}
	}	
for (i=1;i<=4;i++)
{
 	cout<<b[i]<<" " <<a[i]<<endl;
}

}
//********************************************************
//*    ??   1100012931                                 *
//*    ??? ??                                       *
//*    ???  2011.10.29                                *
//********************************************************
int main()
{
	int t[4],i,j,a;
	char x[5]={"zqsl"},b;
	for(t[0]=1;t[0]<=5;t[0]++)
	for(t[1]=1;t[1]<=5;t[1]++)
	for(t[2]=1;t[2]<=5;t[2]++)
    for(t[3]=1;t[3]<=5;t[3]++)
	{
		if(((t[0]+t[1])==(t[3]+t[2]))&&((t[0]+t[3])>(t[1]+t[2]))&&(t[0]+t[2]<t[1]))//????
		 {
			 for(i=0;i<3;i++)//??????
		     for(j=i+1;j<4;j++)
		    {
			     if(t[i]<t[j])
			    {
				  a=t[i];t[i]=t[j];t[j]=a;
			   	  b=x[i];x[i]=x[j];x[j]=b;//????????????
			     }
		     }
    	     for(i=0;i<4;i++)
     	     {cout<<x[i]<<" "<<t[i]*10<<endl;}//???????*10??????
	         return 0;
		  }
      }
}
int main()
{
	int a,b,c,d,i,j;
	int age[4];
	char name[5]={'z','q','s','l'};

	for(a=10;a<=50;a+=10)
	{
		for(b=10;b<=50;b+=10)
		{
			for(c=10;c<=50;c+=10)
			{
				d=a+b-c;
				if(((a+d)>(b+c))&&((a+c)<b)&&(d<=50))
				{
					age[0]=a;
					age[1]=b;
					age[2]=c;
					age[3]=d;
				}
			}
		}
	}
	for(i=0;i<=3;i++)
	{
		for(j=0;j<=2;j++)
		{
			if(age[j]<age[j+1])
			{
				swap(age[j],age[j+1]);
			    swap(name[j],name[j+1]);
			}
		}
	}
	for(i=0;i<4;i++)
		cout<<name[i]<<" "<<age[i]<<endl;
	return 0;
}
//????????????????????????????????????????????????????????10???????????????50?????????????????????????????;
//????????????????????????????????????????????????????????????????????????????????????????????
int main()
{
	int z , q , s , l ;
	for(z=1;z<=5;z++)
	{
		for(q=1;q<=5;q++)
		{
			if(q==z)continue;
			for(s=1;s<=5;s++)
			{
				if((s==q)||(s==z))continue;
				for(l=1;l<=5;l++)
				{
					if((s==l)||(q==l)||(z==l))continue;
					if((z+q)==(s+l)&&((z+l)>(s+q))&&((z+s)<q))
					{
						char a[6]={'o','o','o','o','o'};
						int c[5]={0,0,0,0,0};
						a[z-1]='z';c[z-1]=z*10;
						a[q-1]='q';c[q-1]=q*10;
						a[s-1]='s';c[s-1]=s*10;
						a[l-1]='l';c[l-1]=l*10;
						
						char b[5];int d[4];int m=0;

						for(int n=4;n>=0;n--)
						{
							
							if(a[n]=='o'){}
							else{b[m]=a[n];d[m]=c[n];cout<<b[m]<<" "<<d[m]<<endl;}
							m++;
							
						}



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

					}				
				}						
	return 0;
}
/*
 * 12.cpp
 *
 *  Created on: 2012-10-17
 *      Author: AK
 */
int main()
{
		int z,q,s,l;                 //??z,q,s,l?????????
		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))                  //???????????????????????
						      {
						    	 char a[5][2];                                  //???????????????????
						    	 a[1][1]='z';a[1][2]=z;a[2][1]='q';a[2][2]=q;a[3][1]='s';a[3][2]=s;//
						    	 a[4][1]='l';a[4][2]=l;
						    	 int i,k;                                    //????????????????
						    	 for(k=2;k<=4;k++)
						    		 for(i=4;i>=k;i--)
						    		 {
						    			 if(a[i][2]>a[i-1][2])
						    			 {                             //????????????
						    				 a[5][1]=a[i-1][1];
						    				 a[5][2]=a[i-1][2];
						    				 a[i-1][1]=a[i][1];
						    				 a[i-1][2]=a[i][2];
						    				 a[i][1]=a[5][1];
						    				 a[i][2]=a[5][2];
						    			 }
						    		 }
						    	 cout<<a[1][1]<<' '<<(int)(a[1][2])<<endl;       //??????
						    	 cout<<a[2][1]<<' '<<(int)(a[2][2])<<endl;
						    	 cout<<a[3][1]<<' '<<(int)(a[3][2])<<endl;
						    	 cout<<a[4][1]<<' '<<(int)(a[4][2])<<endl;
							  }
						   }
					}
		return 0;
}
int main()
{
   int z,q,s,l,k,a[4],i,j,m;
   char b[4]={'z','q','s','l'},w;
   for(z=10;z<50;z=z+10)
   {
                        for(q=10;q<50;q=q+10)
                        {
                                            if(z==q)continue;
                                            for(s=10;s<50;s=s+10)
                                           {if(z==s||q==s)continue;
                                           for(l=10;l<50;l=l+10)
                                          if(z==l||q==l||s==l)continue;
                                           if((z+q==s+l)&&(z+l>s+q)&&(z+s<q))
                                           {a[0]=z;
                                           a[1]=q;
                                           a[2]=s;
                                           a[3]=l;
                                                                             
                                                                             
                                           for(i=0;i<3;i++)
                                           {
                                                            for(j=3;j>i;j--)
                                                            {
                                                                               if(a[j]>a[j-1])
                                                                               {
                                                                                  m=a[j];
                                                                                  a[j]=a[j-1];
                                                                                  a[j-1]=m;
                                                                                   w=b[j];
                                                                                  b[j]=b[j-1];
                                                                                  b[j-1]=w;           
                                                                               }
                                                            }
                                           }
                                           cout<<b[0]<<" "<<a[0]<<endl;
                                           cout<<b[1]<<" "<<a[1]<<endl;
                                           cout<<b[2]<<" "<<a[2]<<endl;
                                           cout<<b[3]<<" "<<a[3]<<endl;
                                                                     
                                            }
                                           
                                           }
                        }
   }
cin>>k;
return 0;
}
int main()
{
	int z,q,s,l,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++)
	{
		a[1]=a[2]=a[3]=a[4]=a[5]=0;
		a[z]=a[q]=a[s]=a[l]=1;
		if(a[1]+a[2]+a[3]+a[4]+a[5]==4)
		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;
		
		
		}
	}
	
	return 0;
}
int main()
{
  int z,q,s,l,i,j;
  char name[4]={'z','q','s','l'};
  int t;
  char tname;
  for(z=10;z<=50;z=z+10)
  {
    for(q=10;q<=50;q=q+10)
    {
        if(z==q) continue; 
        for(s=10;s<=50;s=s+10)
       {
          if(z==s||q==s) continue;
                for(l=10;l<=50;l=l+10)
        {
          if(z==l||q==l||s==l) continue;
          else if((z+q)==(s+l)&&(z+l)>(s+q)&&(z+s)<q)
		  {  int result[4]={z,q,s,l};
		   for(i=3;i>0;i--)
			{
				for(j=i-1;j>=0;j--)
				{
				   if(result[i]>result[j])
				   {
				     t=result[i];
					 result[i]=result[j];
					 result[j]=t;
					 tname=name[i];
					 name[i]=name[j];
					 name[j]=tname;
				   }
				}
		    }
		   for(i=0;i<4;i++)
		   {
		    cout<<name[i]<<" "<<result[i]<<endl;
		   }
		  }
        }
      }
    }
  }
 return 0;
}
int main()
{
	int z, q, s, l, num1, num2, num3, num4;
    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)&&(z+l>s+q)&&(z+s<q))
						{
							cout << "l " << 10 * l<< endl;
						    cout << "q " << 10 * q<<endl;
							 cout << "z "<< 10 * z<<endl;
							cout << "s " << 10 * s;
							 
							  
						}
					}
					
				}
                        
			


}
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&&z+l>s+q&&z+s<q)
					{
						if(q>l)
						{
							printf("q %d\n",q*10);
							if(s>l)
							{
								printf("s %d\n",s*10);
								printf("l %d\n",l*10);
								printf("z %d\n",z*10);
							}
							else
							{
								printf("l %d\n",l*10);
								printf("s %d\n",s*10);
								printf("z %d\n",z*10);
							}
						}
						else
						{
							printf("l %d\n",l*10);
							printf("q %d\n",q*10);
							printf("z %d\n",z*10);
							printf("s %d\n",s*10);
						}
					}
				}
			}
		}
	}
	return 0;
}
int main() {
	int z=0,q=0,s=0,l=0;//???????????????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)
						break;
			    }
				if (z+q==s+l && z+l>s+q && z+s<q)
					break;
			}
			if (z+q==s+l && z+l>s+q && z+s<q)
				break;
		}
		if (z+q==s+l && z+l>s+q && z+s<q)
			break;
	}//???????z,q,s,l
    int v[4]={z,q,s,l};
    int vm=0;//???????
    char c[4]={'z','q','s','l'};
    char cm='a';//???????
    for (int i=0;i<4;i++)
    {
    	for (int j=0;j<4;j++)
    	{
    		if (v[i]>v[j])
    			{
    				vm=v[i];
    				v[i]=v[j];
    				v[j]=vm;
    				cm=c[i];
    				c[i]=c[j];
    				c[j]=cm;
    			}
    	}
    }//?????????????????????????
    for (int k=0;k<4;k++)
    	cout << c[k] <<" "<< v[k]*10 << endl;
	return 0;
}
void doublesort(int a,int b,int c,int d)
{
	int result[4]={a,b,c,d};
	char name[4]={'z','q','s','l'};
	
	for(int i=0;i<4;i++)
	{
		for(int j=i;j<4;j++)
		{
			if(result[i]<result[j])
			{
				swap(result[i],result[j]);
				swap(name[i],name[j]);	
			}
		}
	}
	
	for(int i=0;i<4;i++)
	{
		cout<<name[i]<<" "<<10*result[i]<<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)
					{
						doublesort(z,q,s,l);
					}
				}
			}
		}
	}
	return 0;
}
//??? ??? 20121024 

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&&z+l>s+q&&z+s<q)	//???? 
					{
						//?????? 
						for(;;)
						{
							if(z==5)
							{
								cout<<"z 50"<<endl;break;
							}
							
							if(q==5)
							{
								cout<<"q 50"<<endl;break;
							}
							
							
							if(s==5)
							{
								cout<<"s 50"<<endl;break;
							}
							
							if(l==5)
							{
								cout<<"l 50"<<endl;break;
							}
							break;
						}
							
						for(;;)
						{
							if(z==4)
							{
								cout<<"z 40"<<endl;break;
							}
							
							if(q==4)
							{
								cout<<"q 40"<<endl;break;
							}
							
							
							if(s==4)
							{
								cout<<"s 40"<<endl;break;
							}
							
							if(l==4)
							{
								cout<<"l 40"<<endl;break;
							}
							break;
						}
						
						for(;;)
						{
							if(z==3)
							{
								cout<<"z 30"<<endl;break;
							}
							
							if(q==3)
							{
								cout<<"q 30"<<endl;break;
							}
							
							
							if(s==3)
							{
								cout<<"s 30"<<endl;break;
							}
							
							if(l==3)
							{
								cout<<"l 30"<<endl;break;
							}
							break;
						}
						
						for(;;)
						{
							if(z==2)
							{
								cout<<"z 20"<<endl;break;
							}
							
							if(q==2)
							{
								cout<<"q 20"<<endl;break;
							}
							
							
							if(s==2)
							{
								cout<<"s 20"<<endl;break;
							}
							
							if(l==2)
							{
								cout<<"l 20"<<endl;break;
							}
							break;
						}
						
						for(;;)
						{
							if(z==1)
							{
								cout<<"z 10"<<endl;break;
							}
							
							if(q==1)
							{
								cout<<"q 10"<<endl;break;
							}
							
							
							if(s==1)
							{
								cout<<"s 10"<<endl;break;
							}
							
							if(l==1)
							{
								cout<<"l 10"<<endl;break;
							}
							break;
						}
					}
						
						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)
	  {  
		  if(z+l>s+q)
	  {   
		if(z+s<q)
        printf("l %d\nq %d\nz %d\ns %d\n",l*10,q*10,z*10,s*10);
		  }
	  }
    }
    }
    }
    }
}
int main()
{
	int z,q,s,l;
	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)
						continue;
					if (z+q==s+l && z+l>s+q && z+s<q)
					{   
					    cout << "l " << l << endl;
                        cout << "q " << q << endl;
	                    cout << "z " << z << endl;
                        cout << "s " << s << endl;
					}
				}
	return 0;
}
//********************************
//*??????                  *
//*??????                  *
//*2012-10-19                    *
//********************************
int main()
{
	int z, q, s, l,m[4]={1,2,3,4};        //?????????????
	char n[5]="zqsl",r;                   //???????????
	int i=1,j=1,p;                        //???????
	for(z=1;z<=5;z++)                     //??????????????
	{
		for(q=1;q<=5;q++)
		{
			if(q==z) 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;
					if((z+q)==(s+l)&&(z+l)>(s+q)&&(z+s)<q)//???????????
					{
						m[0]=z,m[1]=q,m[2]=s,m[3]=l;      //???m????n???
						for(i=1;i<=3;i++)           //?????????3?
						{
							for(j=0;j<=3-i;j++)     //????????????
							{
								if(m[j]<m[j+1])     //???????
								{
									p=m[j],r=n[j];  //????????????????
									m[j]=m[j+1],n[j]=n[j+1];
									m[j+1]=p,n[j+1]=r;
								}
							}

						}
						for(i=0;i<=3;i++)           //????????
							cout << n[i] << " " << m[i]*10 <<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main(){
	 int z,q,s,l;
	 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) && (z+l >s+q) && (z+s<q)){//??????z,q,s,l
						 if ((z>q)+(z>s)+(z>l)==3) cout<<'z'<<' '<<z<<endl;//???????
						 if ((q>z)+(q>s)+(q>l)==3)cout<<'q'<<' '<<q<<endl;
						 if ((s>z)+(s>q)+(s>l)==3)cout<<'s'<<' '<<s<<endl;
						 if ((l>z)+(l>s)+(l>q)==3)cout<<'l'<<' '<<l<<endl;
						 if ((z>q)+(z>s)+(z>l)==3) cout<<'z'<<' '<<z<<endl;
						 if ((q>z)+(q>s)+(q>l)==2)cout<<'q'<<' '<<q<<endl;//???????
						 if ((s>z)+(s>q)+(s>l)==2)cout<<'s'<<' '<<s<<endl;
						 if ((l>z)+(l>s)+(l>q)==2)cout<<'l'<<' '<<l<<endl;
						 if ((z>q)+(z>s)+(z>l)==1) cout<<'z'<<' '<<z<<endl;//???????
						 if ((q>z)+(q>s)+(q>l)==1)cout<<'q'<<' '<<q<<endl;
						 if ((s>z)+(s>q)+(s>l)==1)cout<<'s'<<' '<<s<<endl;
						 if ((l>z)+(l>s)+(l>q)==1)cout<<'l'<<' '<<l<<endl;
						 if ((z>q)+(z>s)+(z>l)==0) cout<<'z'<<' '<<z<<endl;//???????
						 if ((q>z)+(q>s)+(q>l)==0)cout<<'q'<<' '<<q<<endl;
						 if ((s>z)+(s>q)+(s>l)==0)cout<<'s'<<' '<<s<<endl;
						 if ((l>z)+(l>s)+(l>q)==0)cout<<'l'<<' '<<l<<endl;

					 }
					 }
				 }
		 	 }
	 	 }
		return 0;
	}
int main()
{
	int a[4]={0},w1,w2,w3,w4,i,j,k,h,t;
	char b[4]={'z','q','s','l'},c;
	for(i=1;i<=5;i++)
	{
		w1=i;
		for(j=1;j<=5;j++)
		{
			w2=j;
			for(k=1;k<=5;k++)
			{
				w3=k;
				for(h=1;h<=5;h++)
				{
					w4=h;
					if(((w1+w2)==(w3+w4))&&((w1+w4)>(w2+w3))&&((w1+w3)<w2))
					{
						a[0]=w1;
						a[1]=w2;
						a[2]=w3;
						a[3]=w4;
					}
				}
			}
		}
	}
	for(i=0;i<3;i++)
	 for(j=i+1;j<4;j++)
	 {
		if(a[i]<a[j])
		{
			t=a[i];
			a[i]=a[j];
			a[j]=t;
			c=b[i];
			b[i]=b[j];
			b[j]=c;
		}
	}
	for(i=0;i<4;i++)
	cout<<b[i]<<" "<<a[i]*10<<endl;
	return 0;
}
void main()
{
int z,q,s,l,a[4],t,f=0,d,m;
char i[4],aq[4]={'z','q','s','l'};
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)&&(z+l)>(s+q)&&q>(z+s))
   {a[0]=z,a[1]=q;a[2]=s,a[3]=l;}}}}}


for(d=0;d<4;d++)
{{  for(t=0;t<4;t++)

   if(f<a[t])
 
  f=a[t],i[d]=aq[t],m=t;}

printf("%c %d\n",i[d],f),a[m]=0,f=0;

}
}
int main()
{
	int z,q,s,l,n1,n2,n3,n4,i,j,t,a[4],pd1,pd2;
	char b[4];
	for(n1=1;n1<=5;n1++)
	{
		if(pd2==1)
					{
						break;
					}
		s=n1*10;
		for(n2=1;n2<=5;n2++)
		{
			if(pd2==1)
					{
						break;
					}
			z=n2*10;
			for(n3=1;n3<=5;n3++)
			{
				if(pd2==1)
					{
						break;
					}
				q=n3*10;
				for(n4=1;n4<=5;n4++)
				{
					if(pd2==1)
					{
						break;
					}
					l=n4*10;
					pd1=((z+q==s+l)&&(z+l>s+q))&&(z+s<q);
					if(pd1)
					{
						a[0]=z;
						a[1]=q;
						a[2]=s;
						a[3]=l;
						pd2=1;
					}
				}
			}
		}
	}
	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<=3;i++)
	{
		if(a[i]==z)
		{
			b[i]='z';
		}
		if(a[i]==q)
		{
			b[i]='q';
		}
		if(a[i]==s)
		{
			b[i]='s';
		}
		if(a[i]==l)
		{
			b[i]='l';
		}
	}
	for(i=0;i<4;i++)
	{
		printf("%c ",b[i]);
		printf("%d\n",a[i]);

	}
	return 0;
}
int main()
{
	int z,q,s,l,t;
	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)
					{
						for ( t = 5 ; t >= 1 ; t -- )
						{
							if ( t == z )
								cout<<"z "<<t*10<<endl;
							if ( t == l )
								cout<<"l "<<t*10<<endl;
							if ( t == s )
								cout<<"s "<<t*10<<endl;
							if ( t == q )
								cout<<"q "<<t*10<<endl;
						}
					}
				}
			}
		}
	}
}
//********************************
//*???8.cpp   **
//*?????? 1200012768 **
//*???2013.1.5  **
//*??????  **
//********************************
int main()
{
	int z, q, s, l, i, j;
	for (z = 1; z < 6; z++)
		for (q = 1; q < 6; q++)
		{
			if (q == z)
				continue;
			for (s = 1; s < 6; s++)
			{
				if (s == z || s == q)
					continue;
				for (l = 1; l < 6; l++)
				{
					if (l == z || l == s || l == q)
						continue;
					if ((z + q == s + l) && ((z + l) > (s + q)) && (z + s < q))
					{
						for (i = 5; i > 0; i--)
						{
							if (z == i)
								cout << "z " << z * 10 << endl;
							else if (q == i)
								cout << "q " << q * 10 << endl;
							else if (s == i)
								cout << "s " << s * 10 << endl;
							else if (l == i)
								cout << "l " << l * 10 << endl;
						}
						break;
					}
				}
			}
		}
	return 0;
}
int main()
{
	int w[4],w1[4]; int i,j,max;
	char name[4]={'z','q','s','l'}; //yixia
	for (w[0]=1;w[0]<=5;w[0]++)
		for (w[1]=1;w[1]<=5;w[1]++)
			for (w[2]=1;w[2]<=5;w[2]++)
				for (w[3]=1;w[3]<=5;w[3]++)
					if ((w[0]+w[1]==w[2]+w[3])&&(w[0]+w[3]>w[1]+w[2])&&(w[0]+w[2]<w[1]))  //????????????????????????; ???????????????????????????????????????????
					{
						for (i=0;i<=3;i++) w1[i]=w[i];//???
						for (i=0;i<=3;i++)            //4??????
						{
							max=0;                    //?????
							for (j=1;j<=3;j++)
								if (w1[j]>w1[max]) max=j;//???????
							cout<<name[max]<<' '<<w1[max]*10<<endl;//??
							w1[max]=0;                //?????
						}
					}
	return 0;
}