semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//**************************************************************
//*  ?  ?:???                                             *
//*  ?  ?:???  1200012861                                 *
//*  ?  ?:2012?10?8?                                      *
//**************************************************************
int main()
{
	int z, q, s, l, i, j, order[5], temp;
	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))
						                                        //????????????
					{
						order[1] = z;                           //????????
						order[2] = q;                           //????????
						order[3] = s;                           //????????
						order[4] = l;                           //????????
						break;                                  //????
					}
				}
			}
		}
	}
	
	z = order[1];                                               //????????z
	q = order[2];                                               //????????q
	s = order[3];                                               //????????s
	l = order[4];                                               //????????l
	
	for (j = 1; j <= 3; j++)                                    //????????
	{
		for (i = 1; i <= (4 - j); i++)                          //????
		{
			if (order[i] < order[i + 1])                        //????????
			{
				temp = order[i];                                //
				order[i] = order[i + 1];                        //
				order[i + 1] = temp;                            //???????
			}
		}
	}
	
	for (i = 1; i <= 4; i++)
	{
		if (order[i] == z)                                      //????????i?
			cout << "z " << 10 * order[i] << endl;              //???"z "?????
		if (order[i] == q)                                      //????????i?
			cout << "q " << 10 * order[i] << endl;              //???"q "?????
		if (order[i] == s)                                      //????????i?
			cout << "s " << 10 * order[i] << endl;              //???"s "?????
		if (order[i] == l)                                      //????????i?
			cout << "l " << 10 * order[i] << endl;              //???"l "?????
	}
	return 0;
}
/*??????????????????????????????????????????????
 * ?????????????10????,??????????50???
 * ??????????????????????????;
 * ???????????????????????????????????????????
 * ?????????????????????????????????????????????????
 *????: 2012-10-16
 *??? ??
 */

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

	return 0;
}
int main()
{
	int i,j,k,w,z,q,s,l;
	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(w=1;w<=5;w++)
				{
					l=w;
					if(z+q==s+l&&z+l>s+q&&z+s<q) 
						printf("l %d\nq %d\nz %d\ns %d\n",l*10,q*10,z*10,s*10);
					
				}
			}
		}
	}
	return 0;
}
int main()
{
   int z, q, s, l , i , j , k ;
    for( z = 10; z <= 50 ; z += 10 )
        {for( q = 10 ; q <=50; q += 10 ){ if( z == q ) continue;
            for( s = 10 ; s <= 50; s += 10 ){ if( s == q || s == z )continue;
            
                for( l = 10; l <= 50; l += 10 ){ if( l == s || l == q || l == z )continue;
   
                if( (z + q == s + l) && ( z + l > s + q ) && ( z + s < q )  )
                  {
                   for( i = 50 ; i >= 10 ; i -= 10 )
                   {
                    if( z == i ) printf( "z %d\n",z );
                    if( q == i ) printf( "q %d\n",q );
                    if( s == i ) printf( "s %d\n",s );
                    if( l == i ) printf( "l %d\n",l );
                   }                
                  }               
                }
            }
        }
        }
     

}
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)
						continue;
					if((z+q) == (s+l) && (z+l) > (s+q) && (z+s) < q)
					{
						if(l>q)
						{
							cout << "l " << l <<endl;
							cout << "q " << q <<endl;
							cout << "z " << z <<endl; 
							cout << "s " << s <<endl;
						}	
					}
				}
    return 0;
}
int main()                                  //?????
{
	int p=0;                                //??????p
	char k=0;
	for(int z = 1 ; z < 6 ; z++)            //?????????????z,q,s,l
	{
		for(int q = 1 ; q < 6 ; q++)
		{
			for(int s = 1 ; s < 6 ; s++)
			{
				for(int l = 1 ; l < 6 ; l++)
				{
					if(z+q==s+l && z+l>q+s && z+s<q && z!=q && z!=s && z!=l && q!=s && q!=l && s!=l)    //????
					{
						int a[4];                                //??????
						char b[4];                               //???????
						a[0]=z*10;                                  //???????
						a[1]=q*10;
						a[2]=s*10;
						a[3]=l*10;
						b[0]='z';                                //????????
						b[1]='q';
						b[2]='s';
						b[3]='l';
						for(int i = 0 ; i < 4 ; i++)             //???a??????
						{
							for(int j = i+1 ; j < 4 ; j++)       
							{
								if(a[i]<a[j])
								{
									p=a[j];
									a[j]=a[i];
									a[i]=p;
									
									k=b[j];
									b[j]=b[i];
									b[i]=k;
								}
								else 
									continue;
							}
						}
						cout<<b[0]<<" "<<a[0]<<'\n';             //????
						cout<<b[1]<<" "<<a[1]<<'\n';
						cout<<b[2]<<" "<<a[2]<<'\n';
						cout<<b[3]<<" "<<a[3]<<'\n';	
					}
					else 
						continue;
				}
			}
		}
	}
	return 0;                                                   

}
//***************************************************
//8.cpp ???     ******
//?? ???  1200018209  ********
//?? 2012.10.8 ******
//***************************************************
int main()
{
	int z,q,s,l,a[4],i,j,t;                  //??????????????????
	char b[4],p;                             //????????????
	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)            //??????????
					{
						a[0]=z;a[1]=q;a[2]=s;a[3]=l;
						b[0]='z';b[1]='q';b[2]='s';b[3]='l';      //?????????????
						for(i=0;i<4;i++)
							for(j=i+1;j<4;j++)
								if(a[i]<a[j])                      //????????????
								{
									t=a[j];a[j]=a[i];a[i]=t;
									p=b[j];b[j]=b[i];b[i]=p;            //?????????
								}
					}
				}
	for(i=0;i<4;i++)                              
		cout << b[i] << " " << a[i] <<endl;                      //???????????
	return 0;
}
int a[4], name[4];
int work()
{
  int i, j, t;
  for(i=2; i>=0; i--)
    for(j=0; j<=i; j++)
      if(a[j]<a[j+1])
      {
        t = a[j]; a[j] = a[j+1]; a[j+1] = t;
        t = name[j]; name[j]= name[j+1]; name[j+1] = t;
      }
  for(i=0; i<=3; i++)
  {
    switch(name[i])
    {
      case 0 : printf("z"); break;
      case 1 : printf("q"); break;
      case 2 : printf("s"); break;
      case 3 : printf("l"); break;
    }
    printf(" %d\n", a[i]*10);
  }
  return 0;
}
int main()
{
  int i;
  for(i=0; i<=3; i++)
    name[i] = i;
  for(a[0]=1; a[0]<=5; a[0]++)
    for(a[1]=1; a[1]<=5; a[1]++)
      if(a[1]!=a[0])
      for(a[2]=1; a[2]<=5; a[2]++)
        if(a[2]!=a[1] && a[2]!=a[1])
        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]))
          work();
        }
  return 0;
}
int main()
{
    int z,q,s,l,a,b,c,i;
	char n[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=(z+q==s+l);
					b=(z+l>s+q);
					c=(z+s<q);
					if(a==1&&b==1&&c==1)
					{
						n[z]='z';
						n[q]='q';
						n[s]='s';
						n[l]='l';
						for(i=5;i>=1;i--)
						{
if(i==3)
continue;
							cout<<n[i]<<" "<<i*10<<endl;
						}
					
					}
				}
    return 0;
}
/*
 * practice.cpp
 *
 *  Created on: 2013-12-26
 *      Author: 111
 */

int main()
{
	int z,q,s,l;
	for (z=10;z<60;z+=10)
		for (q=10;q<60;q+=10)
			for(s=10;s<60;s+=10)
				for(l=10;l<60;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)
					{
						for(int i=50;i>0;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 z, q, s, l, m, i;
	char a[6];

	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)
					continue;
				for (l = 1; l <= 5; l++)
				{
					if (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';m = 15 - z -q - s - l;}
				}
			}
		}
	}
	for(i = 5; i > m;i--)
	{
		cout << a[i] << " " << i * 10 << endl;
	}
	for (i = m - 1;i >= 1;i--)
	{
		cout << a[i] << " " << i * 10 << endl;
	}
	cin >> i;
	return 0;
}
int main()
{
    int a[5],i;char n[5]={'l','q','z','s'};
    for(i=0;i<5;i++)
    a[i]=(i+1)*10;
    printf("%c %d\n",n[0],a[4]);
     printf("%c %d\n",n[1],a[3]);
    printf("%c %d\n",n[2],a[1]);
     printf("%c %d\n",n[3],a[0]);
    getchar();getchar();
    
}
int main()
{
	char name[5]={0};
	char s;
	int i,j,k,m,weight[5]={0},t;
	for(i=5;i>0;i--)//?
	{for(j=5;j>0;j--){j!=i;//?
	for(k=5;k>0;k--){k!=i&&k!=j;//?
	for(m=5;m>0;m--){m!=i&&m!=j&&m!=k;//?
	if((i+j==m+k)&&(i+m>j+k)&&(i+k<j))
	{
		weight[1]=i*10;name[1]='z';
		weight[2]=j*10;name[2]='q';
		weight[3]=k*10;name[3]='s';
		weight[4]=m*10;name[4]='l';
	} 
	}			  	
	}
	}
	}
	for(j=1;j<=3;j++)
	{
		for(i=1;i<=4-j;i++)//????
		{ 
			if(weight[i]<weight[i+1])
			{
				t=weight[i];weight[i]=weight[i+1];weight[i+1]=t;
				s=name[i];name[i]=name[i+1];name[i+1]=s;
			}
		}
	}
	for(i=1;i<=4;i++)//??
	{
		cout<<name[i]<<" "<<weight[i]<<endl;
	}
   return 0;
}
//============================================================================
// Name        : 1.cpp
// Author      : ???
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++
//============================================================================


int main()
{
    int i=0,z=0,q=0,s=0,l=0;  //?z,q,s,l????
    for(int z=1;z<=5;z=z+1)
    {

    	for(int q=1;q<=5;q=q+1)
    	{

    		for(int s=1;s<=5;s=s+1)
    		{

    			for(int l=0;l<=5;l=l+1)
    			{
    				if(((z+q)==(s+l))+((z+l)>(s+q))+((z+s)<q)==3)
    				{
					   if(l>q)
					   {
						cout<<"l"<<" "<<l*10<<endl;
						cout<<"q"<<" "<<q*10<<endl;

						    if(z>s)
						    {
							cout<<"z"<<" "<<z*10<<endl;
							cout<<"s"<<" "<<s*10<<endl;
							return 0;
						   }
						else if(s>z)
						{
							cout<<"s"<<" "<<s*10<<endl;
							cout<<"z"<<" "<<z*10<<endl;
						}
					    }
					    else if(q>l)
					     {
					    cout<<"q"<<" "<<q*10<<endl;
					    cout<<"l"<<" "<<l*10<<endl;

					    	if(z>s)
					    	{
					    	cout<<"z"<<" "<<z*10<<endl;
					    	cout<<"s"<<" "<<s*10<<endl;
					    	}
					    	else if(s>z)
					    	{
					    	cout<<"s"<<" "<<s*10<<endl;
					    	cout<<"z"<<" "<<z*10<<endl;
					    	}

					       }
    				}




    			}

    		}

    	}
    	    }
    return 0;

}
int main()
{
    int z,q,s,l,i,m,n,o;
    int A[5]={10,20,30,40,50};
    for (i=0;i<5;i++)
    {
        z=A[i];
        for (m=0;m<5;m++)
        {
            q=A[m];
            for (n=0;n<5;n++)
            {
                s=A[n];
                for (o=0;o<5;o++)
                {
                    l=A[o];
                    if (z+q==s+l&&z+l>s+l&&z+s<q)
                    {
                        cout<<"l"<<" "<<l<<endl;
                        cout<<"q"<<" "<<q<<endl;
                        cout<<"z"<<" "<<z<<endl;
                        cout<<"s"<<" "<<s<<endl;
                    }
                }
            }
        }
    }
    return 0;
}
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)==(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 ;
}
/*
 * ????test3.cpp
 * ???1000012737
 * ????: 2010-11-20
 * ?????????????????????????????
 */

int main(){
	int z,q,s,l;//????
	char c[51];//??????
	for(z=10;z<=50;z+=10)//?????????
		for(q=10;q<=50;q+=10){
			if(q==z)continue;//?????????
			for(s=10;s<=50;s+=10){
				if(s==z||s==q)continue;//?????????
				for(l=10;l<=50;l+=10){
					if(l==z||l==q||l==s)continue;//?????????
					else if((z+q==s+l)&&(z+l>s+q)&&(z+s<q)){
						c[z]='z';c[q]='q';c[s]='s';c[l]='l';
						for(int i=50;i>=10;i-=10){
							if((i==z)||(i==q)||(i==s)||(i==l))
								cout<<c[i]<<' '<<i<<endl;//???????????????????????????????
						}
					}
				}
			}
		}
	return 0;//????
}
//???????
//??????
int main ()
{
	int z,q,s,l;                                          //???????a,q,s,l                                           
	for(z=10;z<=50;z=z+10)                                //????????
	{
		for(q=10;q<=50;q=q+10)
		{
			if(q==z) continue;
			for(s=10;s<=50;s=s+10)
			{
				if(s==z||s==q) continue;
				for(l=10;l<=50;l=l+10)
				{
					if(l==z||l==q||l==s) 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;
}
/*
?? 
??????????????????????????????
??????????????????????????10???????????????50???
??
1\\??????????????????????; 
2\\???????????????????????
3\\??????????????????
??????????===????===???????????????????????????????????
 
???? 
?
 
???? 
??????????????????????????????? 


?? 1000012760
*/



int main(){

	char name[4]= {'z', 'q', 's', 'l'};
	int weight[4]= {0}, cc1, cc2, cc3, i;
	
	for(weight[0]= 10; weight[0]< 60; weight[0]= weight[0]+ 10)
		for(weight[1]= 10; weight[1]< 60; weight[1]= weight[1]+ 10)
			for(weight[2]= 10; weight[2]< 60; weight[2]= weight[2]+ 10)
				for(weight[3]= 10; weight[3]< 60; weight[3]= weight[3]+ 10){
					if((weight[0]!= weight[1]) && (weight[0]!= weight[2]) && (weight[0]!= weight[3]) && (weight[1]!= weight[2]) && (weight[1]!= weight[3]) && (weight[2]!= weight[3])){
					
						cc1= ((weight[0]+ weight[1]) == (weight[2]+ weight[3]));
						cc2= ((weight[0]+ weight[3])> (weight[2]+ weight[1]));
						cc3= ((weight[0]+ weight[2])< weight[1]);
						if((cc1== 1) && (cc2== 1) && (cc3== 1)){
							for(i= 0; i< 4; i++){
								if(weight[i]== 50)
									cout<<name[i]<<' '<<weight[i]<<endl;
							}
							for(i= 0; i< 4; i++){
								if(weight[i]== 40)
									cout<<name[i]<<' '<<weight[i]<<endl;
							}
							for(i= 0; i< 4; i++){
								if(weight[i]== 30)
									cout<<name[i]<<' '<<weight[i]<<endl;
							}
							for(i= 0; i< 4; i++){
								if(weight[i]== 20)
									cout<<name[i]<<' '<<weight[i]<<endl;
							}
							for(i= 0; i< 4; i++){
								if(weight[i]== 10)
									cout<<name[i]<<' '<<weight[i]<<endl;
							}
						}
					}
				}
	
	return 0;
}
/*
						
						if((cc1== 1) && (cc2== 1) && (cc3== 1)){
							if(z== 40)  cout<<"z"<<' '<<"40"<<endl;
							if(q== 40)  cout<<"z"<<' '<<"40"<<endl;
							if(s== 40)  cout<<"z"<<' '<<"40"<<endl;
							if(l== 40)  cout<<"z"<<' '<<"40"<<endl;
						
							if(z== 30)  cout<<"z"<<' '<<"30"<<endl;
							if(q== 30)  cout<<"z"<<' '<<"30"<<endl;
							if(s== 30)  cout<<"z"<<' '<<"30"<<endl;
							if(l== 30)  cout<<"z"<<' '<<"30"<<endl;
							
							if(z== 20)  cout<<"z"<<' '<<"20"<<endl;
							if(q== 20)  cout<<"z"<<' '<<"20"<<endl;
							if(s== 20)  cout<<"z"<<' '<<"20"<<endl;
							if(l== 20)  cout<<"z"<<' '<<"20"<<endl;

							if(z== 10)  cout<<"z"<<' '<<"10"<<endl;
							if(q== 10)  cout<<"z"<<' '<<"10"<<endl;
							if(s== 10)  cout<<"z"<<' '<<"10"<<endl;
							if(l== 10)  cout<<"z"<<' '<<"10"<<endl;


*/
//***************************************************************************************************************************
//???
/*????????????????????????????????????????????????????????10?????
??????????50?????????????????????????????; ??????????????????????
????????????????????????????????????????????????????????????????
??????*/
//***************************************************************************************************************************
int main()
{
   int z,q,s,l,a[4],i,k,p;//z,q,s,l???????a[]???? 
   char m[4]={'z','q','s','l'},j;//???? 
   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)
			   {
			      a[0]=z;
			      a[1]=q;
			      a[2]=s;
			      a[3]=l;
			      
			      for(k=0;k<3;k++)
			      {
                     for(i=0;i<3;i++)
                     {
                        if(a[i]<a[i+1])
                        {
                           p=a[i];
                           a[i]=a[i+1];
                           a[i+1]=p;
                           j=m[i];
                           m[i]=m[i+1];
                           m[i+1]=j;               
                        }                
                     }                
                  }//????????????????  
                 break;            
			   }
			  
			}
		 }
	  }
   }
   for(i=0;i<4;i++)
   {
      cout<<m[i]<<' '<<a[i]*10<<endl;                
   }//?????????
  
   cin.get();
   return 0;
}
int main(){
	int z,q,s,l;		//???????????
	int temp;			
	char tnam;			//???????????
	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(s==z||s==q) continue;
				for(l=10;l<=50;l=l+10){
					if(l==z||l==q||l==s) continue;	//??4??????????????????10???
					if((z+q==s+l)+(z+l>s+q)+(z+s<q)==3){	//?????????
						int wei[4]={z,q,s,l};
						char nam[4]={'z','q','s','l'};		//???????????????????????
						for(int i=1;i<=3;i++)
							for(int j=0;j<=3-i;j++)
								if(wei[j]<wei[j+1]){
									temp=wei[j+1];
									wei[j+1]=wei[j];
									wei[j]=temp;
									tnam=nam[j+1];
									nam[j+1]=nam[j];
									nam[j]=tnam;		//????????????????????
								}
						for(int k=0;k<=3;k++)
							cout<<nam[k]<<" "<<wei[k]<<endl;	//????????????
					}
				}
			}
		}
	return 0;
}
int main()
{
	int i,j,z,q,s,l,w[5][2],d,p;//rank[i][0]???i?????rank[i][1]?????z--1,q--2,s--3,l--4?
	//w[i][0]???i???????????1234?w[i][1]=i(?????????????????????)
	z=q=s=l=0;
	char name[5]={0,'z','q','s','l'};
	for(i=0;i<5;i++)
	{
		w[i][0]=0;
		w[i][1]=i;
	}
	for(z=10;z<51;z+=10)
	{
		for(q=10;q<51;q+=10)
		{
			if(q==z)
				continue;
			for(s=10;s<51;s+=10)
			{
				if(s==z||s==q)
					continue;
				for(l=10;l<51;l+=10)
				{
					if(l==z||l==q||l==s)
						continue;
					if((z+q==s+l)&&(z+l>s+q)&&(z+s<q))
					{
						w[1][0]=z;
						w[2][0]=q;
						w[3][0]=s;
						w[4][0]=l;
						for(i=1;i<5;i++)
						{
							for(j=1;j<5-i;j++)
							{
								if(w[j+1][0]>w[j][0])
								{
									d=w[j+1][0];
									p=w[j+1][1];
									w[j+1][0]=w[j][0];
									w[j+1][1]=w[j][1];
									w[j][0]=d;
									w[j][1]=p;
								}
							}
						}
						for(i=1;i<5;i++)
						{
							cout<<name[w[i][1]]<<' '<<w[i][0]<<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)>(q+s)&&(z+s)<q)
						cout<<"l"<<' '<<l<<endl<<"q"<<' '<<q<<endl<<"z"<<' '<<z<<endl<<"s"<<' '<<s<<endl;
		return 0;
}
int main()
{
int a[4],b[4];
char c;
for(a[1]=10;a[1]<=50;a[1]=a[1]+10)
	for(a[2]=10;a[2]<=50;a[2]=a[2]+10)
		for(a[3]=10;a[3]<=50;a[3]=a[3]+10)
			for(a[4]=10;a[4]<=50;a[4]=a[4]+10)
				if((a[1]+a[2]==a[3]+a[4])&&(a[1]+a[4]>a[2]+a[3]&&(a[1]+a[3]<a[2])))
				{
					b[1]=10000*a[1]+'z';b[2]=10000*a[2]+'q';b[3]=a[3]*10000+'s';b[4]=a[4]*10000+'l';
					cout<<"l "<<a[4]<<endl;
				for(int k=40;k>=10;k=k-10)
				{
					for(int i=1;i<=4;i++)
						if(a[i]==k)
						{
							c=(b[i]%10000);
							cout<<c<<" "<<a[i]<<endl;
						}
				}
				}
return 0;
}
int main()
{
	int z,q,s,l,i;
	for(z=1;z<6;z++)
	for(q=1;q<6;q++)
	{
		if(z==q)
			continue;
		for(s=1;s<6;s++)
		{
			if(s==q||s==z)
				continue;
		for(l=1;l<6;l++)
		{
			if(l==z||l==q||l==s)
				continue;
			if(z+q==l+s)
			if(z+l>s+q)
			if(z+s<q)
			{
				for(i=5;i>0;i--)
				{
					if(i==z)
						cout<<"z"<<" "<<z*10<<endl;
					 else if(i==q)
					    cout<<"q"<<" "<<q*10<<endl; 
					 else if(i==s)
						 cout<<"s"<<" "<<s*10<<endl;
					 else if(i==l)
						 cout<<"l"<<" "<<l*10<<endl;
					 else;
				}
			}
		}
		}
	}
	return 0;
}
/*
 * 13.cpp
 *???
 *  Created on: 2012-10-16
 *      Author: ???
 */
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)//for???????????????
					{
						if(z!=q&&z!=s&&z!=l&&q!=s&&q!=s&&s!=l)//????
						{
							cout<<"l"<<" "<<l<<endl;
							cout<<"q"<<" "<<q<<endl;
							cout<<"z"<<" "<<z<<endl;
							cout<<"s"<<" "<<s<<endl;//??
						}
					}
				}
			}
		}
	}
}
int main ()
{
    int i,j,k,l,m,n;
    int a[4];
    char b[4]={'z','q','s','l'};
    for (i=1;i<6;i++)
    {
        a[0]=i;
        for (j=1;j<6;j++)
        {
            a[1]=j;
            for (k=1;k<6;k++)
            {
                a[2]=k;
                for (l=1;l<6;l++)
                {
                    a[3]=l;
                    if ((a[0]+a[1]==a[2]+a[3])+(a[0]+a[3]>a[2]+a[3])+(a[0]+a[2]<a[1])==3)
                    {
                      for (m=5;m>0;m--)
                      {
                          for (n=0;n<4;n++)
                          {
                              if (a[n]==m)
                              cout <<b[n] <<' ' <<m*10 <<endl;
                          }
                      }
                    }
                }
            }
        }
    }
    return (0);
}
int main()
{
    int z,q,s,l,x1,x2,x3,x4;//?????? 
    for (z=1;z<=5;z++)//z?1?5?? 
    for (q=1;q<=5;q++)//?? 
    for (s=1;s<=5;s++)//??
    for (l=1;l<=5;l++)//??
    {
        if((z+q)==(s+l)) x1=1;//??z+q=s+l,?x1=1 
        else x1=0;//???? 
        if((z+l)>(s+q)) x2=1;//??z+l>s+q,?x2=1 
        else x2=0;//????
        if((z+s)<q) x3=1;//??z+s<q??x3=1 
        else x3=0;//????
        if ((z!=q)&&(z!=s)&&(z!=l)&&(q!=s)&&(q!=l)&&(s!=l)) x4=1;//????????x4=1 
        else x4=0;//????
        if(x1+x2+x3+x4==4)//??????4????? 
        {
            cout <<"l"<<" "<<l*10<<'\n';//?????? 
            cout <<"q"<<" "<<q*10<<'\n';//????? 
            cout <<"z"<<" "<<z*10<<'\n';//????? 
            cout <<"s"<<" "<<s*10<<'\n';//????? 
        }
    }
    
       return 0;
    }