semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	int n,i,j,h=0,i1,j1,m,h1=0,i2,j2;
	char s[100][100];
	double a[100],b[100]={0},c[100]={0},t1,t,min;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s%lf",s[i],&a[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;j<=1;j++){
			if(s[i][j]=='m'){
				b[h]=a[i];
				h++;
	
			}
		}
	}
		for(i1=1;i1<=h;i1++){
			for(j1=0;j1<h-i1;j1++){
				if(b[j1]>b[j1+1]){
					t1=b[j1];
					b[j1]=b[j1+1];
					b[j1+1]=t1;
					
				}
			}
		}
     
	for(i=0;i<n;i++){
		for(j=0;j<=1;j++){
			if(s[i][j]=='f'){
				c[h1]=a[i];
				h1++;
		
			}
		}
	}
		for(i2=1;i2<=h1;i2++){
			for(j2=0;j2<h1-i2;j2++){
				
				if(c[j2]<c[j2+1]){
					
					t=c[j2];
					c[j2]=c[j2+1];
					c[j2+1]=t;
				
				}
			}
		
		}
		for(j=0;j<h;j++){
			printf("%.2lf ",b[j]);
		}
		for(i=0;i<h1-1;i++){
			printf("%.2lf ",c[i]);
		}for(i=0;i<h1;i++){
			if(i==h1-1){
			printf("%.2lf",c[i]);
			}
		}
	
	return 0;
}
//****************************************
//*   ????                           *
//*   ??????                       *
//*   ?????2011?10?30?           *
//****************************************


int main()
{
	int n, i, j, numm, numf;
	double Height, Heightm[40], Heightf[40], p;
	char sex[7];
	cin >> n;//n??????
	numm = 0;//numm??????
	numf = 0;//numf??????
	for(i = 1; i <= n;i ++)
	{
		cin >> sex >> Height;
		if(strlen(sex) == 4)
		{
			numm ++;
			Heightm[numm] = Height;
		}
		else
		{
			numf ++;
			Heightf[numf] = Height;
		}
	}//??????,??????????????
	for(i = 1; i < numm;i ++)
	{
		for(j = i + 1;j <= numm; j ++)
		{
			if(Heightm[i] > Heightm[j])
			{
				p = Heightm[i];
				Heightm[i] = Heightm[j];
				Heightm[j] = p;
			}
		}
	}//??????,???????
	for(i = 1; i <= numm; i ++)
		cout << fixed << setprecision(2) << Heightm[i] << " ";
	for(i = 1; i < numf;i ++)
	{
		for(j = i + 1;j <= numf; j ++)
		{
			if(Heightf[i] < Heightf[j])
			{
				p = Heightf[i];
				Heightf[i] = Heightf[j];
				Heightf[j] = p;
			}
		}
	}//??????,???????
	for(i = 1; i <= numf; i ++)
	{
		if(i < numf)
			cout << Heightf[i] << " ";
		else
			cout << Heightf[i] << endl;
	}
	return 0;
}
int main()
{
	double  boy[40],girl[40],m;
	int  n,c1=0,c2=0,j,k;
	cin>>n;
	char a[10];

	for (int i=0;i<n;i++)
	{
		cin>>a;
		if (a[0]=='m')
		{
			cin>>boy[c1];
			c1++;
		}
		else if (a[0]=='f')
		{
			cin>>girl[c2];
			c2++;
		}
	}


	for (j=0;j<c1-1;j++)
	{
		for ( k=c1-1;k>j;k--)
		{
			if (boy[k]<boy[k-1])
			{
				m=boy[k];boy[k]=boy[k-1];boy[k-1]=m;
			}
		}
	}


	for (j=0;j<c2-1;j++)
	{
		for ( k=c2-1;k>j;k--)
		{
			if (girl[k]>girl[k-1])
			{
				m=girl[k];girl[k]=girl[k-1];girl[k-1]=m;
			}
		}
	}

	cout<<fixed<<setprecision(2)<<boy[0];
	for (j=1;j<c1;j++)
	{
		cout<<fixed<<setprecision(2)<<" "<<boy[j];
	}
	for (j=0;j<c2;j++)
	{
		cout<<fixed<<setprecision(2)<<" "<<girl[j];
	}
	cout<<endl;
	return 0;
}
int main(){
	int a,b,c,d=0,l=0,o,p,w;
	double h;
	char e[42][10];
	double f[42],m[42],g[42];
	scanf("%d",&a);
	for(b=0;b<a;b++){
		scanf("%s%lf",e[b],&g[b]);
		w=strcmp(e[b],"male");
		if(w==0){
			m[d]=g[b];
			d++;
		}
		else{
			f[l]=g[b];
			l++;
		}
	}
	for(o=0;o<d;o++){
		for(p=o+1;p<d;p++){
			if(m[p]<m[o]){
				h=m[o];
				m[o]=m[p];
				m[p]=h;
			}
		}
	}
	for(o=0;o<l;o++){
		for(p=o+1;p<l;p++){
			if(f[p]>f[o]){
				h=f[o];
				f[o]=f[p];
				f[p]=h;
			}
		}
	}
	for(o=0;o<d;o++){
		printf("%.2lf ",m[o]);
	}
	for(o=0;o<(l-1);o++){
		printf("%.2lf ",f[o]);
	}
	printf("%.2lf",f[l-1]);
	return 0;
}
int main()
{   
	double h[40],tmp;
	int n,i,j,k=0;
	char c[7];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s %lf",c,&h[i]);
		if(c[0]=='f'){
			h[i]=-h[i];
			k++;
		}
	}
	  for(i=n-1;i>0;i--){   
		for(j=0;j<i;j++){
			if(h[j]>h[j+1]){
				tmp=h[j+1];
				h[j+1]=h[j];
				h[j]=tmp;
			}
		}
	}
    for(i=k;i<n;i++){            
		printf("%.2lf ",h[i]);
	}
    for(i=0;i<k-1;i++){
		printf("%.2lf ",(-h[i]));
	}
	printf("%.2lf\n",(-(h[k-1])));
	return 0;
}
main()
{
      int n,k,i=0,j=0,countm=0,countf=0,I,J;
      char sex[50][10]={'\0'};
      float h[50]={0},m[50]={0},f[50]={0};
      float temp;
      scanf("%d",&n);
      for(k=0;k<n;k++)
      {
            scanf("%s %f",sex[k],&h[k]);          
      }
      for(k=0;k<n;k++)
      {
            if(sex[k][0]=='m')
            {
                    m[i]=h[k];
                    i++;
                    countm++;          
            } 
            else
            {
                    f[j]=h[k];
                    j++;
                    countf++;
            }         
      }
      for(i=countm-1;i>0;i--)
      {
             for(I=0;I<i;I++)
             {
                       if(m[I]>m[I+1])
                    {
                           temp=m[I+1];
                           m[I+1]=m[I];
                           m[I]=temp;        
                    }      
             }                
      }
      for(j=countf-1;j>0;j--)
      {
             for(J=0;J<j;J++)
             {
                      if(f[J]>f[J+1])
                    {
                           temp=f[J+1];
                           f[J+1]=f[J];
                           f[J]=temp;        
                    }       
             }                
      }
      for(i=0;i<countm;i++)
      printf("%.2f ",m[i]);
      for(j=countf-1;j>0;j--)
      printf("%.2f ",f[j]);
      printf("%.2f",f[0]);
      getchar();
      getchar(); 
      getchar();
      getchar();
}
int main()
{
	char a[700];
	double m[700],f[700],t;
	int n,i,j=0,k=0,ml=0,fl=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",&a);
		if(a[0]=='m')
		{
			scanf("%lf",&m[j++]),ml++;
		}
		else scanf("%lf",&f[k++]),fl++;
	}
	for(k=ml-1;k>0;k--)
	{
		for(j=0;j<k;j++)
		{
			if(m[j]>m[j+1])
			{
				t=m[j];
				m[j]=m[j+1];
				m[j+1]=t;
			}
		}
	}
	for(k=fl-1;k>0;k--)
	{
		for(j=0;j<k;j++)
		{
			if(f[j]<f[j+1])
			{
				t=f[j];
				f[j]=f[j+1];
				f[j+1]=t;
			}
		}
	}
	for(i=0;i<ml;i++)
	{
		printf("%.2lf ",m[i]);
	}
	for(i=0;i<fl-1;i++)
	{
		printf("%.2lf ",f[i]);
	}
	printf("%.2lf",f[fl-1]);
}
int main(){
	int n,i,j=0,k=0,x,y,q[40];
	double c[40],d[40],e[40],z;
	char b[40];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s %lf",&b,&c[i]);
		if(strcmp(b,"male")==0)
		{
			q[i]=1;
		}
		else
		{
			q[i]=0;
		}
	}
	for(i=0;i<n;i++)
	{
		if(q[i]==1)
		{
			d[j]=c[i];
			j++;
		}
		if(q[i]==0)
		{
			e[k]=c[i];
			k++;
		}
	}
	for(i=0;i<j;i++)
	{
		for(x=i+1;x<j;x++)
		{
			if(d[x]<d[i])
			{
				z=d[i];
				d[i]=d[x];
				d[x]=z;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		for(x=i+1;x<k;x++)
		{
			if(e[x]>e[i])
			{
				z=e[i];
				e[i]=e[x];
				e[x]=z;
			}
		}
	}
	for(i=0;i<j;i++)
	{
		printf("%.2lf ",d[i]);
	}
	for(i=0;i<k-1;i++)
	{
		printf("%.2lf ",e[i]);
	}
	printf("%.2lf",e[k-1]);


	return 0;
}
int main()

{

	int n,m,o,i,j;

	double a[81]={0};

	char b[41][7];

	cin>>n;

	for(i=1;i<=n;i++)

	{

		cin>>b[i]>>a[i];

	}

	m=1;

	o=0;

	for(i=1;i<=n;i++)

	{

		if(b[i][0]=='m')

		{
			
			a[m+n]=a[i];

			m++;

		}

		if(b[i][0]=='f')

		{
			a[2*n-o]=a[i];

			o++;

		}

	}

	double x;
	
	for(i=1+n;i<=m+n-1;i++)

	{

		for(j=m+n-1;j>i;j--)

		{

			if(a[j]<a[j-1])

			{

				x=a[j];

				a[j]=a[j-1];

				a[j-1]=x;

			}

		}

	}

	for(i=m+n;i<=2*n;i++)

	{

		for(j=2*n;j>i;j--)

		{

			if(a[j]>a[j-1])

			{

				x=a[j];

				a[j]=a[j-1];

				a[j-1]=x;

			}

		}

	}

	for(i=n+1;i<2*n;i++)

	{

		cout<<fixed;
		
		cout<<setprecision(2)<<a[i]<<" ";

	}

	cout<<fixed;

	cout<<setprecision(2)<<a[2*n];

	return 0;
}
int cmp(const void *p1,const void *p2)
{
	if(*(float*)p1<*(float*)p2) return -1;
	else if(*(float*)p1>*(float*)p2) return 1;
	else return 0;
}

void photo(float *a,float *b,int n)
{
	int x=0,y=0,i;
	char s[7];
	for(i=0;i<n;i++)
	{
		scanf("%s",s);
		getchar();
		if(s[4]=='\0')
		{
			scanf("%f",a+x);
			x++;
		}
		else
		{
			scanf("%f",b+y);
			y++;
		}
		getchar();
	}
	qsort(a,x,sizeof(float),cmp);
	qsort(b,y,sizeof(float),cmp);
	for(i=0;i<x;i++) printf("%.2f ",a[i]);
	for(i=y-1;i>0;i--) printf("%.2f ",b[i]);
	printf("%.2f",b[0]);
}

main()
{
	float a[40],b[40];
	int n;
	scanf("%d\n",&n);
	photo(a,b,n);
}
int compare(void const *p,void const *q)
{
     if (*(double*)p>*(double*)q)
     return 1;
     else
     return -1;
}
 main()
{
    int n,i,j,k;
    double a[40];
    double b[40];
    double d[40];
    char c[40][4];
    k=0;
    j=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%s %lf",&c[i],&d[i]);
        if(c[i][0]=='m')
        {
        a[j]=d[i];
        j++;
        }
        else
        {
         b[k]=d[i];
         k++;
        }
    }
    qsort(a,j,sizeof(double),compare);
    qsort(b,k,sizeof(double),compare);
    printf("%0.2lf",a[0]);
    for(i=1;i<j;i++)
    {
     printf(" %0.2lf",a[i]);
    }
    for(i=k-1;i>-1;i--)
    {
     printf(" %0.2lf",b[i]);
    }
}
int cprx(const void *e1,const void *e2)
{
    float *a,*b;
    a=(float *)e1;
    b=(float *)e2;
    if (*a-*b<0) return -1;
    else return 1;
}
int cprd(const void *e1,const void *e2)
{
    float *a,*b;
    a=(float *)e1;
    b=(float *)e2;
    if (*a-*b>0) return -1;
    else return 1;
}
int main()
{
   float male[40],female[40],tmph;
   int m=0,f=0,n,i;
   char sex[10];
   scanf("%d",&n);
   for (i=0;i<n;i++)
   {
       scanf("%s %f",sex,&tmph);
       if (sex[0]=='m') male[m++]=tmph;
       else female[f++]=tmph;
   }
   qsort(male,m,sizeof(float),cprx);
   qsort(female,f,sizeof(float),cprd);
   for (i=0;i<m;i++)
     printf("%.2f ",male[i]);
   for (i=0;i<f-1;i++)
     printf("%.2f ",female[i]);
   printf("%.2f",female[i]);
   return 0;
}
int main(){
	int n;
	char zfc[1000][7];
	double sg[100];
	double nsg[100];
	double nvsg[100];
	int nsm=0;
	int nvsm=0;
	int k,i;
	int e=0;
	int s=0;
	double r,t;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s%lf",&zfc[i],&sg[i]);
	}
	for(i=0;i<n;i++){
		if(zfc[i][0]=='m'){
			nsm=nsm+1;
			e=e+1;
			nsg[e-1]=sg[i];
		}else if(zfc[i][0]=='f'){
			nvsm=nvsm+1;
			s=s+1;
			nvsg[s-1]=sg[i];
		}
	}
	for(k=0;k<nsm;k++){
		for(i=0;i<nsm-1-k;i++){
			if(nsg[i]>nsg[i+1]){
					r=nsg[i+1];
					nsg[i+1]=nsg[i];
					nsg[i]=r;
			}
		}
	}
	for(k=0;k<nvsm;k++){
		for(i=0;i<nvsm-1-k;i++){
			if(nvsg[i]<nvsg[i+1]){
					t=nvsg[i+1];
					nvsg[i+1]=nvsg[i];
					nvsg[i]=t;
			}
		}
	}
	for(i=0;i<nsm;i++){
		printf("%.2lf ",nsg[i]);
	}
	for(i=0;i<nvsm-1;i++){
		printf("%.2lf ",nvsg[i]);
	}
	printf("%.2lf",nvsg[nvsm-1]);
	return 0;
}
struct paixu{
       char sex[6];
       float height;
};
typedef struct paixu Paixu;
void bubble1(Paixu*,int);
void bubble2(Paixu*,int,int);
main()
{
   Paixu a[40],b[40];
   int n,i,k=0,m;
   scanf("%d",&n);
   for(i=0;i<=n-1;i++)
   scanf("%s %f",&a[i].sex,&a[i].height);
   for(i=0;i<=n-1;i++)
   if(a[i].sex[0]=='m')
   {
                       b[k]=a[i];
                       k++;
   }
   m=k;
   for(i=0;i<=n-1;i++)
   if(a[i].sex[0]=='f')
   {
                       b[k]=a[i];
                       k++;
   }
   bubble1(b,m);
   bubble2(b,m,n);
   for(i=0;i<=n-1;i++)
   {
                      printf("%.2f",b[i].height);
                      if(i!=n-1)
                      printf(" ");
   }
}
void bubble1(Paixu b[],int m)
{
     int pass,i;
     Paixu hold;
     for(pass=1;pass<=m-1;pass++)
     for(i=0;i<=m-2;i++)
     if(b[i].height>b[i+1].height)
     {
                 hold=b[i];
                 b[i]=b[i+1];
                 b[i+1]=hold;
     }
}
void bubble2(Paixu b[],int m,int n)
{
     int pass,i;
     Paixu hold;
     for(pass=1;pass<=n-m;pass++)
     for(i=m;i<=n-2;i++)
     if(b[i].height<b[i+1].height)
     {
                 hold=b[i];
                 b[i]=b[i+1];
                 b[i+1]=hold;
     }
}
int main(){
	int n,i,k;
	double sz[40][2],e;
	char s[7];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",s);
		if(strcmp(s,"male")==0)
			sz[i][0]=0;
		else
			sz[i][0]=1;
		scanf("%lf",&sz[i][1]);
	}
	for(i=1;i<n;i++){
		for(k=0;k<n-i;k++){
			if(sz[k][0]==1&&sz[k+1][0]==0||sz[k][0]==1&&sz[k+1][0]==1&&sz[k][1]<sz[k+1][1]||sz[k][0]==0&&sz[k+1][0]==0&&sz[k][1]>sz[k+1][1]){
				e=sz[k][1];
				sz[k][1]=sz[k+1][1];
				sz[k+1][1]=e;
				e=sz[k][0];
				sz[k][0]=sz[k+1][0];
				sz[k+1][0]=e;
			}
		}
	}	
	for(i=0;i<n-1;i++)
		printf("%.2lf ",sz[i][1]);
	printf("%.2lf",sz[n-1][1]);

	return 0;
}
int main() {
	int i,n,j=0,k=0,l;
	double t;
	char a[100][10];
	double b[100],m[100],f[100];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s%lf",a[i],&b[i]);
	}
	for(i=0;i<n;i++){
		if(a[i][0]=='m'){
			m[j]=b[i];
			j++;
		}
	}
	for(i=0;i<n;i++){
		if(a[i][0]=='f'){
			f[k]=b[i];
			k++;
		}
	}
    for(i=0;i<j;i++){
		for(l=i+1;l<j;l++){
			if(m[l]<m[i]){
				t=m[i];
				m[i]=m[l];
				m[l]=t;
			}
		}
	}

for(i=0;i<k;i++){
		for(l=i+1;l<k;l++){
			if(f[l]>f[i]){
				t=f[i];
				f[i]=f[l];
				f[l]=t;
			}
		}
	}
	for(i=0;i<j;i++){
		printf("%.2lf ",m[i]);
	}
	for(i=0;i<k-1;i++){
		printf("%.2lf ",f[i]);
               
	}
        printf("%.2lf",f[k-1]);
	return 0;
}
main()
{
      int n,i=0,j=0,h=0,p,q,m;
      scanf("%d",&n);
      char string[]="male";
      char sex[n][6];
      float height[n],male[n],female[n];
      float change;
      while(i<n){
                 scanf("%s %f",&sex[i],&height[i]);
                 i++;
                 }
      for(i=0;i<n;i++){
                       if(strcmp(sex[i],string)==0){
                                                    male[j]=height[i];
                                                    j++;
                                                    }
                       else{
                            female[h]=height[i];
                            h++;
                            }
                       }
      for(p=0;p<=j;p++){
                       m=j-1;
                       while(m>0){
                                  if(male[m]<=male[m-1]){
                                                         change=male[m];
                                                         male[m]=male[m-1];
                                                         male[m-1]=change;
                                                         }
                                   m=m-1;
                                   }
                       }
      for(p=0;p<=h;p++){
                       m=h-1;
                       while(m>0){
                                  if(female[m]<=female[m-1]){
                                                             change=female[m];
                                                             female[m]=female[m-1];
                                                             female[m-1]=change;
                                                             }
                                   m=m-1;
                                   }
                       }
      for(p=0;p<j;p++){
                       printf("%.2f ",male[p]);
                       }
      for(p=h-1;p>0;p--){
                         printf("%.2f ",female[p]);
                         }
      printf("%.2f",female[0]);}
int main()
{
	float temp, male[40], female[40];
	int n, i, j, p, q;
	char sex[8];
	cin >> n;
	for (i = 0, p = 0, q = 0; i < n; i++)
	{
		cin >> sex >> temp;
		if (strcmp(sex, "male") == 0)
		{
			male[p] = temp;
			p++;
		}
		else
		{
			female[q] = temp;
			q++;
		}
	}
	for (i = 0; i < p - 1; i++)
		for (j = 0; j < p - 1 - i; j++)
		{
			if (male[j] > male[j + 1])
			{
				temp = male[j];
				male[j] = male[j + 1];
				male[j + 1] = temp;
			}
		}
	for (i = 0; i < q - 1; i++)
		for (j = 0; j < q - 1 - i; j++)
		{
			if (female[j] < female[j + 1])
			{
					temp = female[j];
					female[j] = female[j + 1];
					female[j + 1] = temp;
			}
		}
	cout << fixed << setprecision(2) << male[0];
	for (i = 1; i < p; i++)
		cout << fixed << setprecision(2) << " " << male[i];
	for (i = 0; i < q; i++)
		cout << fixed << setprecision(2) << " " << female[i];
	return 0;
}
int main()
{
    char sex[10];
    int n=0,count=0,count1=0,count2=0;
    int boy_num=0,girl_num=0;
    double temp,height,boy[40],girl[40];
    scanf("%d",&n);
    
    for(count=0;count<n;++count)  
    {
        scanf("%s%lf",sex,&height); 
        if(!strcmp(sex,"male")){
            boy[boy_num]=height;
            boy_num++;    
        }else {
            girl[girl_num]=height;
            girl_num++;
        }
    }
    //????  ?? 
    for(count1=0;count1<boy_num;++count1)
    {
        for(count2=0;count2<boy_num-count1-1;++count2)  
        {
            if(boy[count2]>boy[count2+1])
            {
                temp = boy[count2];
                boy[count2]=boy[count2+1];
                boy[count2+1] = temp;
            }    
        }  
    }
     //????  ??  
    for(count1=0;count1<girl_num;++count1)
    {
        for(count2=0;count2<girl_num-count1-1;++count2)  
        {
            if(girl[count2]<girl[count2+1])
            {
                temp = girl[count2];
                girl[count2]=girl[count2+1];
                girl[count2+1] = temp;
            }    
        }  
    }
    for(count=0;count<boy_num;++count)
    {
        printf("%.2f ",boy[count]);    
    }
    for(count=0;count<girl_num-1;++count)
    {
        printf("%.2f ",girl[count]);    
    }
    printf("%.2f",girl[count]);
}
int main(){
int n,k=0,e=0,i,j;
char o[41][5];
double m[41],g[41],t[41],f[41],a,b;
scanf("%d",&n);
for (i=0;i<n;i++)
{
	scanf("%s %lf",o[i],&g[i]);
}
for(i=0;i<n;i++)
{
	if(o[i][0]=='m')
	{
		t[k]=g[i];
		k++;
	}
	else 
	{
		f[e]=g[i];
		e++;
	}
}
for(i=k;i>0;i--)
{
	for(j=0;j<i-1;j++)
	{
		if(t[j+1]<t[j])
		{a=t[j+1];
		t[j+1]=t[j];
		t[j]=a;
		}
	}
}
for(i=e;i>0;i--)
{
	for(j=0;j<i-1;j++)
	{
		if(f[j+1]<f[j])
		{a=f[j+1];
		f[j+1]=f[j];
		f[j]=a;
		}
	}
}
for(i=0;i<k;i++)
{
	printf("%.2lf ",t[i]);
}
for(i=e-1;i>0;i--)
{
	printf("%.2lf ",f[i]);
}
	printf("%.2lf",f[0]);
	return 0;
}
int main()
{
    struct{
           char xb[7];
           double sg;}xs[50];
    char s1[5]={'m','a','l','e','\0'};
    char s2[7]={'f','e','m','a','l','e','\0'};
    int n,i,j1,j2,m1,m2,k1,k2;
    double m[50],w[50],t;
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
                     scanf("%s %lf\n",xs[i].xb,&xs[i].sg);}
    for(i=0,j1=0;i<n;i++){
                         if(strcmp(xs[i].xb,s1)==0){
                                              m[j1]=xs[i].sg;
                                              j1++;}
                                              }
    for(i=0,j2=0;i<n;i++){
                          if(strcmp(xs[i].xb,s2)==0){
                                              w[j2]=xs[i].sg;
                                              j2++;}
                                              }
    for(m1=1;m1<j1;m1++){
                           for(k1=j1-1;k1>m1-1;k1--){
                                                 if(m[k1-1]>m[k1]){
                                                                 t=m[k1-1];
                                                                 m[k1-1]=m[k1];
                                                                 m[k1]=t;}}}
    for(m2=1;m2<j2;m2++){
                           for(k2=j2-1;k2>m2-1;k2--){
                                                 if(w[k2-1]<w[k2]){
                                                                 t=w[k2-1];
                                                                 w[k2-1]=w[k2];
                                                                 w[k2]=t;}}}
    for(i=0;i<j1;i++){
                        printf("%.2lf ",m[i]);}
    for(i=0;i<j2-1;i++){
                        printf("%.2lf ",w[i]);}
    printf("%.2lf",w[j2-1]);
    return 0;
}
int main(){
	int n,i,j,q=-1,p=-1;
	double sh[100],fe[120],me[120],t,min1,min2;
	char a[100][10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s %lf",a[i],&sh[i]);
	}
	for(i=0;i<n;i++){
		if(strcmp(a[i],"male")==0){
			p++;
			me[p]=sh[i];
		
		}
		else if(strcmp(a[i],"female")==0){
			q++;
			fe[q]=sh[i];
		}
	}
	for(i=0;i<=p;i++)
		for(j=i+1;j<=p;j++)
			if(me[i]>me[j]){
				t=me[i];
				me[i]=me[j];
				me[j]=t;}
	for(i=0;i<=q;i++)
		for(j=i+1;j<=q;j++)
			if(fe[i]<fe[j]){
				t=fe[i];
				fe[i]=fe[j];
				fe[j]=t;}
	printf("%.2lf",me[0]);
	for(i=1;i<=p;i++)
		printf(" %.2lf",me[i]);
	for(i=0;i<=q;i++)
		printf(" %.2lf",fe[i]);
    return 0;
		
}
struct info{
	double height;
	char sex[10];
}p[41];
double pm[41],pf[41];

int comp_m(const void *a,const void *b){
	return (*((double*)a)-*((double*)b))>0?1:(*((double*)a)-*((double*)b)<0?-1:0);
}

int comp_f(const void *a,const void *b){
	return (*((double*)b)-*((double*)a))>0?1:(*((double*)b)-*((double*)a)<0?-1:0);
}

int main(){
	int n;
	int i;
	int index_m,index_f;
	while(cin>>n){
		index_m=0;
		index_f=0;
		for(i=0;i<n;i++){
			cin>>p[i].sex>>p[i].height;
			if(!strcmp(p[i].sex,"male")){
				pm[index_m++]=p[i].height;
			}
			else{
				pf[index_f++]=p[i].height;
			}
		}
		qsort(pm,index_m,sizeof(double),comp_m);
		qsort(pf,index_f,sizeof(double),comp_f);
		for(i=0;i<index_m;i++){
			printf("%.2f ",pm[i]);
		}
		for(i=0;i<index_f-1;i++){
			printf("%.2f ",pf[i]);
		}
		printf("%.2f",pf[i]);
	}
	return 0;
}
int main()
{
	char sex[40][6];
	float height[40], Female[40], Male[40], temp1, temp2;
	int i, p, j = 0, k = 0, n;

	cin >> n;
	for (i = 0; i < n; i ++)
	{
		cin >> sex[i];
		cin >> height[i];
	}

	for (i = 0; i < n; i ++)
	{
		if (sex[i][0] == 'f')
		{
			Female[j] = height[i];
			j ++;
		}
		else if (sex[i][0] == 'm')
		{
			Male[k] = height[i];
			k ++;
		}
	}
	// ??????



	for (i = 0; i < k - 1; i ++)
	{
		for (p = 0; p < k - 1 - i; p ++)
		{
			if (Male[p] > Male[p+1])
			{
				temp1 = Male[p];
				Male[p] = Male[p+1];
				Male[p+1] = temp1;
			}
		}
	}
	for (i = 0; i < j - 1; i ++)
	{
		for (p = 0; p < j - 1 - i; p ++)
		{
			if (Female[p] < Female[p+1])
			{
				temp2 = Female[p];
				Female[p] = Female[p+1];
				Female[p+1] = temp2;
			}
		}
	}
	// ??,?????

	for (i = 0; i < k; i ++)
	{
		cout << fixed << setprecision(2) << Male[i] << " ";			
	}
	for (i = 0; i < j; i ++)
	{
		if (i < j - 1)
			cout << fixed << setprecision(2) << Female[i] << " ";
		else
			cout << fixed << setprecision(2) << Female[i];
	}
	// ???????????



	return 0;
}
int main(){
char sex[8];
int n,i,m1,m2,j;
double a[41],b[41],t;
scanf("%d",&n);
m1=0;
m2=0;
for (i=1;i<=n;i++){
scanf("%s%lf",sex,&t);
if (sex[0]=='m') {m1=m1+1;a[m1]=t;}
if (sex[0]=='f') {m2=m2+1;b[m2]=t;}
}
for (i=1;i<=m1;i++)
for (j=1;j<=m1-i;j++)
if (a[j]>a[j+1]){
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
for (i=1;i<=m1;i++) printf("%.2lf ",a[i]);
for (i=1;i<=m2;i++)
for (j=1;j<=m2-i;j++)
if (b[j]>b[j+1]){
t=b[j];
b[j]=b[j+1];
b[j+1]=t;
}
for (i=m2;i>=2;i--) printf("%.2lf ",b[i]);
printf("%.2lf",b[1]);
return 0;
}
main()
{
	void sx(float p[],int n);
	void jx(float p[],int n);
	float f[45],m[45],w[45];
	char a[45][10];
	int n,i,j=0,k=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%s%f",a[i],&w[i]);
	for(i=0;i<n;i++)
	{
		if(a[i][0]=='m')
		{
			m[j]=w[i];
			j++;
		}
		if(a[i][0]=='f')
		{
			f[k]=w[i];
			k++;
		}
	}
	sx(m,j);
	jx(f,k);
	for(i=0;i<j;i++)
	printf("%.2f ",m[i]);
	for(i=0;i<k-1;i++)
	printf("%.2f ",f[i]);
	printf("%.2f",f[k-1]);

}
void sx(float p[],int n)
{
	int i,j;
	float t;
	for(i=0;i<n;i++)
	for(j=0;j<i;j++)
	if(p[i]<p[j])
	{
		t=p[i];
		p[i]=p[j];
		p[j]=t;
	}	
}
void jx(float p[],int n)
{
	int i,j;
	float t;
	for(i=0;i<n;i++)
	for(j=0;j<i;j++)
	if(p[i]>p[j])
	{
		t=p[i];
		p[i]=p[j];
		p[j]=t;
	}	
}