semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
int a=0,b=0,c=0,a1,b1,c1;//a b c???A B C???   a1 b1 c1 ?ABC????????? 
     for(a=1;a<=3;a++)
     {
                      for(b=1;b<=3;b++)
                      {
                                       for(c=1;c<=3;c++)
                                       {
                                            a1=(b>a)+(c==a);
                                            b1=(a>b)+(a>c);
                                            c1=(c>b)+(b>a);
                                            if((a+a1==3)&&(b+b1==3)&&(c+c1==3))
                                             {
                                                   if(a==1)
                                                   cout<<"A"; 
                                                   if(b==1)
                                                   cout<<"B";
                                                   if(c==1)
                                                   cout<<"C"; 
                                                   if(a==2)
                                                   cout<<"A"; 
                                                   if(b==2)
                                                   cout<<"B";
                                                   if(c==2)
                                                   cout<<"C";
                                                   if(a==3)
                                                   cout<<"A"; 
                                                   if(b==3)
                                                   cout<<"B";
                                                   if(c==3)
                                                   cout<<"C"; 
                                                                            
                                             }           
                                       }                 
                      }                 
     }
return 0;
}
/*
 * bifanliang.cpp
 *
 *  Created on: 2012-10-19
 *      Author: 99003
 */

int main() {
	int a, b, c;
	int i,j,t;
	int sum1, sum2, sum3;
	int arr[10];
	char name[10];
	for (a = 0; a <= 2; a = a + 1) {//abc???10 2??????
		for (b = 0; b <= 2; b = b + 1) {
			for (c = 0; c < 2; c = c + 1) {
				if (a != b && b != c && a != c) {
					sum1 = (b > a) + (c == a);
					sum2 = (a > b) + (a > c);
					sum3 = (c > b) + (b > a); //sum????????
					if (a + sum1 == b + sum2 && b + sum2 == c + sum3) {
						arr[0] = a; //???????
						arr[1] = b;
						arr[2] = c;
						name[0] = 'A';
						name[1] = 'B';
						name[2] = 'C';
						name[3] = '\0';
						for (i = 0; i < 3; i++)
							for (j = i + 1; j < 3; j++)
								if (arr[i] > arr[j]) {
									t = arr[i];
									arr[i] = arr[j];
									arr[j] = t;
									t = name[i];
									name[i] = name[j];
									name[j] = t;
								}
						cout << name[0]<<name[1]<<name[2];

					}
				}
			}
		}
	}
	return 0;
}
int main()
{
    int a,b,c;
    char Ra,Rb,Rc;
    for (a = 1; a <= 3; a++)
    {
        for (b = 1; b <= 3; b++)
        {
            for (c = 1; c <= 3; c++)
            {
                Ra = (b > a) + (c == a);
                Rb = (a > b) + (a > c);
                Rc = (c > b) + (b > a);
                if ( Ra == 3 - a && Rb == 3 - b && Rc == 3 - c)
                {
                    if (a > b && b > c)
                        cout << "CBA";
                    else
                    {
                        if (a > c && c > b)
                            cout << "BCA";
                        else
                        {
                            if (b > a && a > c)
                                cout << "CAB";
                            else
                            {
                                if (b > c && c > a)
                                    cout << "ACB";
                                else
                                {
                                    if (c > a && a > b)
                                        cout << "BAC";
                                    else
                                    {
                                        if (c > b && b > a)
                                            cout << "ABC";
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return 0;
}
main()
{
      char a,b,c,A,B,C;
      a=C;
      b=A;
      c=B; 
      printf("BCA");
      getchar();
}
/**
* @file		????.cpp
* @author	??	1000012792
* @date		2010.11.15
*/
int main()
{
	int a, b, c;
	for(a=0;a<3;a++)							//0,1,2????????
		for(b=0;b<3;b++)
			for(c=0;c<3;c++)
			{
				if((a + (b>a) + (c==a) == 2)&&  //??????????????????2
					(b + (a>b) + (a>c) == 2)&&
					(c + (c>b) + (b>a) == 2))
				if(a>b)							//??????????????????ABC
				{
					if(b>c)
						cout << "CBA";
					else
					{
						if(a>c)
							cout <<"BCA";
						else
							cout <<"BAC";
				
					}
				}
				else
				{
					if(a>c)
						cout << "CAB";
					else
					{
						if(b>c)
							cout <<"ACB";
						else
							cout << "ABC";
					}
				}

			}
		return 0;
}
/*
 * 3.15.cpp
 *
 *  Created on: 2013-10-17
 *      Author: st
 */
int main()
{
	int A=0,B=0,C=0;
	for(A=1;A<=3;A++)//3???
		for(B=1;B<=3;B++)
			for(C=1;C<=3;C++)
			{
				if(A>B&&B>C)//???????????????????????
					{if(((B>A)+(C==A))<((A>B)+(A>C))&&((A>B)+(A>C))<((C>B)+(B>A)))
						cout<<"CBA"<<endl;}
				else if(A>C&&C>B)
				    {if(((B>A)+(C==A))<((C>B)+(B>A))&&((C>B)+(B>A))<((A>B)+(A>C)))
				    	cout<<"BCA"<<endl;}
				else if(B>A&&A>C)
				    {if(((A>B)+(A>C))<((B>A)+(C==A))&&((B>A)+(C==A))<((C>B)+(B>A)))
					cout<<"CAB"<<endl;}
				else if(B>C&&C>A)
				    {if(((A>B)+(A>C))<((C>B)+(B>A))&&((C>B)+(B>A))<((B>A)+(C==A)))
					cout<<"ACB"<<endl;}
				else if(C>A&&A>B)
				    {if(((C>B)+(B>A))<((B>A)+(C==A))&&((B>A)+(C==A))<((A>B)+(A>C)))
				    	cout<<"BAC"<<endl;}
				else if(C>B&&B>A)
				    {if(((C>B)+(B>A))<((A>B)+(A>C))&&((A>B)+(A>C))<((B>A)+(C==A)))
					cout<<"ABC"<<endl;}
			}
	return 0;

}
int main()
{
	int a,b,c;	//?????abc????????0?1?2
	int t,p;	//???????????t?p
	int i,j;	//??????i,j
	int m[4];	//????m??a,b,c??
	char n[4];	//????n??a?b,c,????
	for(a=0;a<=2;a++)
		for(b=0;b<=2;b++)
			for(c=0;c<=2;c++)
				{if((b>a)+(c==a)==(2-a)&&(a>b)+(a>c)==(2-b)&&(c>b)+(b>a)==(2-c))
				//?????????2-a??????????????????
			{m[1]=a;m[2]=b;m[3]=c;
	n[1]='A';n[2]='B';n[3]='C';
		for(j=1;j<=2;j++)
			for(i=1;i<=3-j;i++)
				if(m[i]>m[i+1])
				{t=m[i];m[i]=m[i+1];m[i+1]=t;
				 p=n[i];n[i]=n[i+1];n[i+1]=p;}		//?????????
	} }
		cout<<n[1]<<n[2]<<n[3]<<endl;
	return 0;
}
int main()
{
 int a[3],word[3];//a????????word?????? 
 char b[3];//b??? 
 for(int i=0;i<3;i++)
   for(int j=0;j<3;j++)//?????? 
     {
      if(j==i)continue;//???????? 
      int k=3-i-j;
      a[0]=i,a[1]=j,a[2]=k;
      word[0]=(a[1]>a[0])+(a[0]==a[2]);//?????? 
      word[1]=(a[0]>a[1])+(a[0]>a[2]);
      word[2]=(a[2]>a[1])+(a[1]>a[0]);
      if(a[0]+word[0]==2&&a[1]+word[1]==2&&a[2]+word[2]==2)//???? 
          {
           b[a[0]]='A';
           b[a[1]]='B'; 
           b[a[2]]='C';
           cout<<b[0]<<b[1]<<b[2];//????? 
          } 
      } 
 cin.get();cin.get();
 return 0;
}
int main()
{
	int A,B,C,word[4];
	char rank[4];
	for(A=1;A<=3;A++) //??????????????1?2?3
	{
		for(B=1;B<=3;B++)
		{
			if (B==A) continue;//?????
			else
			{
				for(C=1;C<=3;C++)
				{
					if((C==B)||(C==A)) continue;
					else
					{
						word[A]=(B>A)+(C==A);
						word[B]=(A>B)+(A>C);
						word[C]=(C>B)+(B>A);//?????????
						rank[A]='A';
						rank[B]='B';
						rank[C]='C';
						if ((word[1]>word[2])&&(word[2]>word[3]))//????????
							cout<<rank[1]<<rank[2]<<rank[3]<<endl;
					}
				}
			}
		}
	}
	return 0;
}
int main()
{
	int i=0,j=0;
	for (i=0;i<=2;i++)
		for(j=0;j<=2;j++)
			for(int k=0;k<=0;k++)
				if ((i!=j)+(i!=k)+(j!=k)==3)
				{
					char a,b,c;
					a=(i<j)+(i==k);
					b=(i>j)+(i>k);
					c=(j<k)+(i<j);
					if((i<j<k)+(a>b>c)==2)
						cout<<"ABC"<<endl;
					if((i<k<j)+(a>c>b)==2)
						cout<<"ACB"<<endl;
					if((j<i<k)+(b>a>c)==2)
						cout<<"BAC"<<endl;
					if((j<k<i)+(b>c>a)==2)
						cout<<"BCA"<<endl;
					if((k<i<j)+(c>a>b)==2)
						cout<<"CAB"<<endl;
					if((k<j<i)+(c>b>a)==2)
						cout<<"CBA"<<endl;
				}
	return 0;
}
int main()
{
	int a=0,b=0,c=0;
	int a1,a2,b1,b2,c1,c2;
	int A,B,C;

	  for(a=0;a<=2;a++)
		 for(b=0;b<=2;b++)
			for(c=0;c<=2;c++)	//??a,b,c?????2,1,0???????
			{
				  if(b>a) a1=1;else a1=0;
			      if(c==a)a2=1;else a2=0;
			      if(a>b) b1=1;else b1=0;
			      if(a>c) b2=1;else b2=0;
			      if(c>b) c1=1;else c1=0;
			      if(b>a) c2=1;else c2=0;//?????????????????1????0
			      A=a1+a2,B=b1+b2,C=c1+c2;//?????????????ABC??
				   if(a>b && b>c && A<B && B<C)cout<<"CBA";
				   if(a>c && c>b && A<C && C<B)cout<<"BCA";
				   if(b>a && a>c && B<A && A<C)cout<<"CAB";
				   if(b>c && c>a && B<C && C<A)cout<<"ACB";
				   if(c>a && a>b && C<A && A<B)cout<<"BAC";
				   if(c>b && b>a && C<B && B<A)cout<<"ABC";//????a,b,c???C,B,A???????????????
				   
				  
	       }

			
			return 0;
}
//**********************************************************
//*   ?  ?   ?: ???.cpp                              *
//*   ?       ?: ? ?                                   *
//*   ? ? ? ?: 2010?10?17?                          *
//**********************************************************
int main()
{
	int A, B, C,i=0;
	int rank[4]={0,0,0,0},words[4]={0,0,0,0};                             //??word????????rank??????????
	for(A=1;A<4;A++)
	{
		for(B=1;B<4;B++)
		{
			if(A==B)  continue;
			C=6-B-A;                                                      //A?B?C???????
			words[1]=(B>A)+(A==C);
			words[2]=(A>B)+(A>C);
			words[3]=(C>B)+(B>A);
			rank[A]=1;
			rank[B]=2;
			rank[C]=3;                                                    //??????????
			if(words[rank[1]]==2&&words[rank[2]]==1&&words[rank[3]]==0)   //???????????
			{
				for(i=1;i<4;i++)
					cout<<(char)(rank[i]+64);
                                                                          //?????????
			}
		}
	}
	return 0;
}
int main()
{
    int A,B,C,i; int D,E,F,H,I,J;
    for(A=1;A<=3;A++)
     for(B=1;B<=3;B++)
      for(C=1;C<=3;C++)
      {

         D=(B>A);H=(C==A);
         E=(A>B);I=(A>C);
         F=(C>B);J=(B>A);

         if (D+H+A==3 && E+I+B==3 && F+J+C==3)
              {
                  char a[4];
                  a[A]='A';a[B]='B';a[C]='C';
                  for(i=1;i<=3;i++) cout<<a[i];
              }
      }
  return 0;
}
/*
 * ???.cpp
 *
 *  Created on: 2012-10-14
 *      Author: ??
 */

int main()
{
	int A,B,C,cc1,cc2,cc3;    //A,B,C????????????cc1,cc2,cc3????????
	for (A = 0;A <= 2;A ++){
		for (B = 0;B <= 2;B ++){
			if (B == A) continue;
			for (C = 0;C <= 2;C ++){
				if ((C == A) || (C == B))  continue;

				cc1 = (B > A) + (C == A);
				cc2 = (A > B) + (A > C);
				cc3 = (C > B) + (B > A);

				if ((A + cc1 == 2) && (B + cc2 == 2) && (C + cc3 == 2))
				{
                   if (A == 2 && B == 1 && C == 0)   cout <<"CBA" <<endl;
                   if (A == 2 && B == 0 && C == 1)   cout <<"BCA" <<endl;
                   if (A == 1 && B == 2 && C == 0)   cout <<"CAB" <<endl;
                   if (A == 1 && B == 0 && C == 2)   cout <<"BAC" <<endl;
                   if (A == 0 && B == 1 && C == 2)   cout <<"ABC" <<endl;
                   if (A == 0 && B == 2 && C == 1)   cout <<"ACB" <<endl;

				}
			}
		}
	}
	return 0;
}
//**********************
int a=0,b=0,c=0;
int words[4];
char rank[4];
//**********************
int main()
{
    for (int i=0;i<=3;i++)
    {words[i]=0;}
    
    for(a=1;a<=3;a++)
    {  
       for (b=1;b<=3;b++)
           { if(b==a)continue;
             for(c=1;c<=3;c++)
             {if(b==c||a==c)continue;
             words[1]=(b>a)+(c==a);//????
             words[2]=(a>b)+(a>c);
             words[3]=(c>b)+(b>a);
              if (words[1] == words[2]
                     || words[2] == words[3]
                     || words[3] == words[1])//a,b,c??????
                   continue;


             for(int i=1;i<=3;i++)//??
             {
                     if(words[i]==2)
                     rank[1]=i+64;
                     else if(words[i]==1)
                     rank[2]=i+64;
                     else if(words[i]==0)
                     rank[3]=i+64;}}
             }}
             cout<<rank[1]<<rank[2]<<rank[3];
                          return 0;
    }
int main()
{
	void output(int a,int b,int c,int k);
	int a,b,c;
	for(a=1;a<=3;a++)
		for(b=1;b<=3;b++)
		{
			c=6-a-b;
			if(a*b*c==6&&((b>a)+(c==a)==3-a&&(a>b)+(a>c)==3-b&&(c>b)+(b>a)==3-c))
			{
				output(a,b,c,1);
				output(a,b,c,2);
				output(a,b,c,3);
			}
        }
		return 0;
}



void output(int a,int b,int c,int k)
{
	if (a==k)cout<<"A";
    else if(b==k)cout<<"B";
	else cout<<"C";
}
int main()                                                    //?????
{

	for(int A=0 ; A<3 ; A++)                                  //??A B C?????
	{
		for(int B=0 ; B<3 ; B++) 
		{
			for(int C=0 ; C<3 ; C++)
			{
				int a=0;                                      //??????a,b,c
			    int b=0;
				int c=0;
				if(B>A)                                       //??A????????
					a++;
				if(C==A)                                     
					a++;
				if(A>B)                                       //??B????????
					b++;
				if(A>C)                                         
					b++;
				if(C>B)                                       //??C????????
					c++;
				if(B>A)                                       
					c++;
				if(((A==B && a==b) || ((A-B)*(a-b)<0)) && ((A==C && a==c) || ((A-C)*(a-c)<0)) && ((B==C && b==c) || ((B-C)*(b-c)<0)))  //????????????????????
				{
					int p;
					int a[10];                                //????????a
					char b[10];                               //?????????b
					char k;                                   //????k
					a[0]=A;                                   //?A,B,C????a??
					a[1]=B;
					a[2]=C;
					b[0]='A';                                 //?A,B,C??????b??
					b[1]='B';
					b[2]='C';
					for(int i = 0 ; i < 3 ; i++)              //?A,B,C?????
					{
						for(int j = i+1 ; j < 3 ; j++)
						{
							if(a[i]>a[j])
							{
								p=a[i];
								a[i]=a[j];
								a[j]=p;

								k=b[i];
								b[i]=b[j];
								b[j]=k;
								
							}
						}
					}
					cout<<b[0]<<b[1]<<b[2]<<endl;            //????

				}
					

			}
		}
	}
      return 0;                                             //???????????????????

}
int main()
{
int a,b,c,judgea,judgeb,judgec,ta,tb,tc;
for(a=1;a<=3;a++)
   for(b=1;b<=3;b++)
      for(c=1;c<=3;c++)
         {
          ta=(b>a)+(c==a);
          tb=(a>b)+(a>c);
          tc=(c>b)+(b>a);
          if((a-b)*(ta-tb)<0||a==b&&ta==tb)
             judgea=1;
          if((a-c)*(ta-tc)<0||a==c&&ta==tc)
             judgeb=1;
          if((b-c)*(tb-tc)<0||b==c&&tb==tc)
             judgec=1;
          if(judgea==judgeb&&judgeb==judgec)
          {
          if(a<=c&&a<=b)
              if(b<=c)
                  cout<<'A'<<'B'<<'C';
                  else
                      cout<<'A'<<'C'<<'B';
          if(b<=c&&b<=a)
              if(c<=a)
                   cout<<'B'<<'C'<<'A';
                   else
                       cout<<'B'<<'A'<<'C';
          if(c<=b&&c<=a)
               if(b<=a)
                     cout<<'C'<<'B'<<'A';
                     else
                        cout<<'C'<<'A'<<'B';
        a=b=c=9;
        }
	   }
return 0;
	
          
}
int main()
{
	int a,b,c,i,j;
	char d[3]={0};
	for(a=1;a<3;a++)
	{
		for(b=0;b<3;b++)
		{
			for(c=0;c<3;c++)
			{	
				if(a+b+c==3&&a+(b>a)+(c==a)==2&&b+(a>b)+(a>c)==2&&c+(c>b)+(b>a)==2)
					{
						d[a]='A';
						d[b]='B';
						d[c]='C';
					}
			}
		}
	}
for(i=0;i<3;i++)
	cout<<d[i];
}
int main()
{
	int A=0,B=0,C=0;
	char d[4]={'0','0','0','0'};
	int i=0,j=0,k=0;
	for(i=0;i<=2;i++)
	{
		for(j=0;j<=2;j++)
			{
				if(i==j)continue;
				for(k=0;k<=2;k++)
				{
					if(i==k||j==k)continue;
					A=(j>i);
					B=(i>j)+(i>k);
					C=(k>j)+(j>i);
					if((A==(2-i))&&(B==(2-j))&&(C==(2-k)))
					{
						d[i]='A';d[j]='B';d[k]='C';
					}
				}
		}
	}
	for(i=0;i<=2;i++)cout<<d[i];
	return 0;
}
struct l
{
       char s[10];
       float h;
} a[40];
main()
{
      int i=0,j=0,k=0,w=0,n;
      float b[40],c[40],tmp=0;
      scanf("%d",&n);
      for(i=0;i<=n-1;i++)
      scanf("%s%f",a[i].s,&a[i].h);
      for(i=0;i<=n-1;i++)
      {
                         
                         if(strcmp(a[i].s,"male")==0)
                         {b[j]=a[i].h;j++;}
                         if(strcmp(a[i].s,"female")==0)
                         {c[k]=a[i].h;k++;}
      }
      for(w=j-1;w>0;w--)
      {
      for(i=0;i<=j-2;i++)
      {if(b[i]>b[i+1])
      {tmp=b[i+1];
       b[i+1]=b[i];
       b[i]=tmp;
                     }}}
                     for(w=k-1;w>0;w--)
                     {
       for(i=0;i<=k-2;i++)
      {if(c[i]<c[i+1])
      {tmp=c[i+1];
       c[i+1]=c[i];
       c[i]=tmp;
                     }}}
                     for(i=0;i<=j-1;i++)
                     printf("%.2f ",b[i]);
                      for(i=0;i<=k-2;i++)
                     printf("%.2f ",c[i]);
                     printf("%.2f",c[i]);
                                                     
      getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
}
int main(){
  int n,i,t=0,m=0,j;
  double gao[40],b[40],e,c[40];
  char a[40][7];
  scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%s%lf",a[i],&gao[i]);
  }
  for(i=0;i<n;i++){
	  if(a[i][0]=='m'){b[t]=gao[i];t++;}
  }
  
  for(i=0;i<n;i++){
	  if(a[i][0]=='f'){c[m]=gao[i];m++;}
  }

  for(i=1;i<=t;i++){
	  for(j=0;j<t-i;j++){
		  if(b[j]>b[j+1]){e=b[j];b[j]=b[j+1];b[j+1]=e;}
	  }
  }
   for(i=1;i<=m;i++){
	  for(j=0;j<m-i;j++){
		  if(c[j]<c[j+1]){e=c[j];c[j]=c[j+1];c[j+1]=e;}
	  }
  }
   for(i=0;i<t;i++){
   printf("%.2lf ",b[i]);}
   printf("%.2lf",c[0]);
    for(i=1;i<m;i++){
   printf(" %.2lf",c[i]);}
return 0;}
double male[40];
double female[40];
char str[10];

int cmp1(const void *a,const void *b)//up
{
  return *(double *)a < *(double *)b;
}

int cmp2(const void *a,const void *b)//down
{
  return *(double *)b < *(double *)a;
}

int main()
{
  int i,n,maleindex,femaleindex;
  double temp;
  while(cin>>n)
  {
	maleindex = femaleindex = 0;
	while(n--)
	{
		cin>>str>>temp;
		if(strcmp(str,"male") == 0)
		  male[maleindex++] = temp;
		else 
		  female[femaleindex++] = temp;
	}

	qsort(male,maleindex,sizeof(male[0]),cmp2);
    qsort(female,femaleindex,sizeof(female[0]),cmp1);
    
	printf("%.2lf",male[0]);
	for(i = 1;i < maleindex;i++)
	  printf(" %.2lf",male[i]);

	for(i = 0;i < femaleindex;i++)
	  printf(" %.2lf",female[i]);
	printf("\n");
  }
  return 0;
}
int compare1( const void *a , const void *b)
{
	int *p = (int *)a;
	int *q = (int *)b;
	if(*p > *q)
	{
		return 1;
	}
	else if(*p == *q)
	{
		return 0;
	}
	else
	{
		return -1;
	}
}//nv

int compare2( const void *a ,  const void *b)
{
	int *p = (int *)a;
	int *q = (int *)b;
	if(*p > *q)
	{
		return -1;
	}
	else if(*p == *q)
	{
		return 0;
	}
	else
	{
		return 1;
	}
}//nan

int main(int argc, char* argv[])
{
	int male = 0;
	int female = 0;
	int n;
	int i;
	float a[40];
	float b[40];
	char c[10];
	float d;
	scanf("%d" , &n);
	for(i = 0 ; i < n ; i++)
	{
		scanf("%s" , c);
		if(!strcmp(c , "male"))
		{
			scanf("%f" , &d);
			a[male] = d;
			male++;
		}
		else
		{
			scanf("%f" , &d);
			b[female] = d;
			female++;
		}		
	}
	//painansheng
	qsort(a , male , sizeof(float) , compare1);
	qsort(b , female , sizeof(float) , compare2);
	for(i = 0 ; i < male ; i++)
	{
		printf("%.2f " , a[i]);
	}
	for(i = 0 ; i < female ; i++)
	{
		printf("%.2f" , b[i]);
		if(i != female-1)
		{
			printf(" ");
		}
	}
	printf("\n");

	return 0;

}
double f[100];
double g[100];

int main()
{
	int m=0,n=0;
	int t;
	cin >>t;
	int i;
	while (t--)
	{
		double tmp;
		char sx[10];
		cin >>sx;
		cin >>tmp;
		if (strcmp(sx,"male") == 0) f[m++]=tmp;
		else g[n++]=tmp;
	}
	sort(f,f+m);
	sort(g,g+n);
	for (i=0;i<m;i++) printf("%.2f ", f[i]);
	for (i=n-1;i>=0;i--) 
	{
		if (i!=0)
			printf("%.2f ", g[i]);
		else 
			printf("%.2f", g[i]);
	}
	cout <<endl;
	return 0;
}
int main(){
	int n, i, j, k, a=0, b=0;
	double h[40], boy[40], girl[40], e;
	char s[40][10];
	scanf("%d", &n);
	for(i=0;i<n;i++){
		scanf("%s %lf", s[i], &h[i]);
		if(strcmp(s[i], "male")==0){
			boy[a]=h[i];
			a++;
		}
		else{
			girl[b]=h[i];
			b++;
		}
	}
	for(k=1;k<a;k++){
		for(i=0;i<a-k;i++){
			if(boy[i+1]<boy[i]){
				e=boy[i+1];
				boy[i+1]=boy[i];
				boy[i]=e;
			}
		}
	}
	for(i=0;i<a;i++){
		printf("%.2lf ", boy[i]);
	}
	for(k=1;k<b;k++){
		for(i=0;i<b-k;i++){
			if(girl[i+1]>girl[i]){
				e=girl[i+1];
				girl[i+1]=girl[i];
				girl[i]=e;
			}
		}
	}
	for(i=0;i<b-1;i++){
		printf("%.2lf ", girl[i]);
	}
	printf("%.2lf", girl[b-1]);
	return 0;
}
int main(){
double h,p,b[40],c[40];
	int n,i,t,j=1,k=1;
	char a[10],d[5]={"male"},e[7]={"female"};
scanf("%d",&n);
for (i=1;i<=n;i++){
scanf("\n%s",a);
scanf("%lf",&h);
if (strcmp(a,d)==0) {
b[j]=h;
j+=1;
continue;
}
if (strcmp(a,e)==0){
c[k]=h;
k=k+1;
}
}
j=j-1;
k=k-1;
for (i=1;i<=j;i++)
for (t=i;t<=j;t++)
if (b[i]>b[t]) {
p=b[i];
b[i]=b[t];
b[t]=p;
}
for (i=1;i<=k;i++)
for (t=i;t<=k;t++)
if (c[i]<c[t]) {
p=c[i];
c[i]=c[t];
c[t]=p;
}
for (i=1;i<=j;i++)
printf("%.2lf ",b[i]);
for (i=1;i<k;i++)
printf("%.2lf ",c[i]);
printf("%.2lf",c[k]);

return 0;
}
int main(){
	double sg[40],male[40],female[40],e;
	char xb[40][7];
	int n,i,j,l,k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s%lf",xb[i],&sg[i]);
	}
	j=0;
	k=0;
	int result;
	for(i=0;i<n;i++){
		result=strcmp(xb[i],"male");
		if(result==0){
			male[j]=sg[i];
			j++;
		}else{
			female[k]=sg[i];
			k++;
		}
	}
	for(l=1;l<=j;l++){
		for(i=0;i<j-l;i++){
			if(male[i]>male[i+1]){
				e=male[i+1];
				male[i+1]=male[i];
				male[i]=e;
			}
		}
	}
	for(l=1;l<=k;l++){
		for(i=0;i<k-l;i++){
			if(female[i]<female[i+1]){
				e=female[i+1];
				female[i+1]=female[i];
				female[i]=e;
			}	
		}
	}
	for(i=0;i<j;i++){
		printf("%.2lf ",male[i]);
	}
	for(i=0;i<k-1;i++){
		printf("%.2lf ",female[i]);
	}
	printf("%.2lf",female[k-1]);
return 0;
}
int main()
{
    int i,j,n,r=0,y=0;
    char s[100][100];
    double b[100],m[100],w[100],temp;
    scanf("%d",&n);
    for(i=0;i<2*n;i++)
    {
                    scanf("%s",s[i]);
    }
    for(i=0;i<2*n;i++)
    {
                      if(((i%2)==0)&&(s[i][0]=='m'))
                      {
                                                   m[r]=atof(s[i+1]);
                                                   r++;
                      }
                      else if(((i%2)==0)&&(s[i][0]=='f'))
                      {
                           w[y]=atof(s[i+1]);
                           y++;
                      }
    } 
    for(i=1;i<r;i++)
    {
                    for(j=0;j<r-i;j++) 
                    {
                                       if(m[j]>m[j+1])
                                       {
                                                      temp=m[j];
                                                      m[j]=m[j+1];
                                                      m[j+1]=temp;
                                       } 
                    }
    }
     for(i=1;i<y;i++)
    {
                    for(j=0;j<y-i;j++) 
                    {
                                       if(w[j]<w[j+1])
                                       {
                                                      temp=w[j];
                                                      w[j]=w[j+1];
                                                      w[j+1]=temp;
                                       } 
                    }
    }
    printf("%.2f",m[0]);
    for(i=1;i<r;i++) 
    printf(" %.2f",m[i]);
    for(i=0;i<y;i++) 
    printf(" %.2f",w[i]);
}