semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int n,i;
    float h;
    char str[10];
    int k=0,j=0;
    float male[40],famale[40];
    male[0]=0;
    famale[0]=0;
    cin >> n;
    int len;
    for (i=1;i<=n;i++)
    {
        cin >> str >> h;
        len=strlen(str);
        if (len==4)
        {
                      k++;
                      male[k]=h;
        }
        else
        {
                      j++;
                      famale[j]=h;
        }
    }
        int p,q;
        float temp;
        for (p=1;p<=k-1;p++)
        {
            for (q=1;q<=k-p;q++)
            {
                if (male[q]>male[q+1])
                {
                                      temp=male[q+1];
                                      male[q+1]=male[q];
                                      male[q]=temp;
                }
            }
        }
        for (p=1;p<=j-1;p++)
        {
            for (q=1;q<=j-p;q++)
            {
                if (famale[q]>famale[q+1])
                {
                                      temp=famale[q+1];
                                      famale[q+1]=famale[q];
                                      famale[q]=temp;
                }
            }
        }
        printf("%.2f",male[1]);
        for (p=2;p<=k;p++)
        {
            cout << " " ;
            printf("%.2f",male[p]);
 
        }
        for (q=j;q>=1;q--)
        {
            cout << " " ;
            printf("%.2f",famale[q]);
        }
    
      
        return 0;
    }
int main()
{
	int n,i,k,l,m=0,p=0;
	double sz[40],e;
	double a[40];
	double b[40];
	char zfc[40][10];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",zfc[i]);
		scanf("%lf",&sz[i]);
		if(zfc[i][0]=='m'){
			a[m]=sz[i];
			m++;
		}
		else if(zfc[i][0]=='f'){ 
			b[p]=sz[i];
			p++;
		}
	}
		for(k=1;k<=m;k++){
			for(l=0;l<m-k;l++){
				if(a[l]>a[l+1]){
					e=a[l+1];
					a[l+1]=a[l];
					a[l]=e;
				}
			}
		}
    	for(k=1;k<=p;k++){
			for(l=0;l<p-k;l++){
				if(b[l]<b[l+1]){
					e=b[l+1];
					b[l+1]=b[l];
					b[l]=e;
				}
			}
    	}
	for(l=0;l<m;l++){
		printf("%.2lf ",a[l]);
	}
	printf("%.2lf",b[0]);
	for(l=1;l<p;l++){
		printf(" %.2lf",b[l]);
	}
	return 0;
}
int cmp1(float a,float b)
{
	if(a>b)
		return 1;
	else 
		return 0;
}
int cmp2(float a,float b)
{
	if(a<b)
		return 1;
	else 
		return 0;
}
float mail[1000];
float femail[1000];
char sex[1000];
int main()
{
	//freopen("D:\\1.txt","r",stdin);
	int N;
	cin>>N;
	int i,j,k;
	j=0;
	k=0;
	float temp;
	for(i=0;i<N;i++)
	{
		cin>>sex;
		cin>>temp;
		if(strcmp(sex,"male")==0)
			mail[j++]=temp;
		else 
			if(strcmp(sex,"female")==0)
			femail[k++]=temp;
	}
	sort(mail,mail+j,cmp1);
	sort(femail,femail+k,cmp1);
	for(i=j-1;i>=0;i--)
		printf("%.2f ",mail[i]);
	for(i=0;i<k;i++)
		if(i!=k-1)
		printf("%.2f ",femail[i]);
		else
			printf("%.2f\n",femail[i]);
	return 0;
}
int main(){
	int all,count1,count2,i,p;
	double h1[40],h2[40],h,ex;
	char input[6];
	scanf("%d",&all);
	count1=0;count2=0;
	for(i=0;i<all;i++){
		scanf("\n%s %lf",input,&h);
		if(input[0]=='m'){h1[count1]=h;count1++;}
		if(input[0]=='f'){h2[count2]=h;count2++;}

	}
	for(i=0;i<count1;i++){
		for(p=0;p<count1-1;p++){
			if(h1[p]>h1[p+1]){
				ex=h1[p+1];
				h1[p+1]=h1[p];
				h1[p]=ex;
			}
		}
	}
	for(i=0;i<count2;i++){
			for(p=0;p<count2-1;p++){
				if(h2[p]<h2[p+1]){
					ex=h2[p+1];
					h2[p+1]=h2[p];
					h2[p]=ex;
				}
			}
		}
	printf("%.2lf",h1[0]);
	for(i=1;i<count1;i++){printf(" %.2lf",h1[i]);}
	for(i=0;i<count2;i++){printf(" %.2lf",h2[i]);}

	
	
return 0;
}
int sf(const void* a, const void* b)
{
	if((*((double*)a)) > (*((double*)b)))
		return 1;
	if((*((double*)a)) < (*((double*)b)))
		return -1;
	return 0;
}

int main()
{
	int i;
	int n;
	double f[40], m[40];
	int fn = 0, mn = 0;
	char str[20];
	scanf("%d", &n);
	for(i = 0; i < n; i++)
	{
		scanf("%s", str);
		if(str[0] == 'f')
			scanf("%lf", &f[fn++]);
		else
			scanf("%lf", &m[mn++]);
	}
	qsort(f, fn, sizeof(double), sf);
	qsort(m, mn, sizeof(double), sf);
	for(i = 0; i < mn; i++)
		printf("%.2lf ", m[i]);
	for(i = fn - 1; i > 0; i--)
		printf("%.2lf ", f[i]);
	if(fn > 0)
		printf("%.2lf", f[0]);
	return 0;
}
int main()
{
	int n;
	int fe[40];
	int ma[40];
	float f;
	cin>>n;
	int i;
	char b[10];
	int fec=0,mac=0;
	for(i=0;i<n;i++)
	{
		cin>>b;
		if(strcmp(b,"male")==0)
		{
		//		scanf("%f",&f);
			cin>>f;
			ma[mac]=(int)(f*1000);
			mac++;
		}
		if(strcmp(b,"female")==0)
		{
			scanf("%f",&f);
			//cin>>f;
			fe[fec]=(int)(f*1000);
			fec++;
		}
	}
	sort(ma,ma+mac);
	sort(fe,fe+fec);
	for(i=0;i<mac;i++)
	{
		
		if(ma[i]%10>=4)
			ma[i]++;
		//cout<<ma[i]/100.0<<" ";
		printf("%.2f ",ma[i]/1000.0);
	}
	for(i=fec-1;i>=0;i--)
	{
	
		if(fe[i]%10>=4)
			fe[i]++;
	//	cout<<fe[i]/100.0<<" ";
		if(i>0)
			printf("%.2f ",fe[i]/1000.0);
		if(i==0)
			printf("%.2f",fe[i]/1000.0);
	}
	printf("\n");
	return 0;
}
int main ()
{
    char flag[10];
    float temp;
    float boy[1000], girl[1000];
    int k, i, j = 0, z = 0, lenb = 0, leng = 0, n;
    cin >> n;
    for (k = 0 ; k < n; k++)
    {
        cin >> flag;
        if (strcmp(flag, "female") == 0)
        {
            leng++;
            cin >> girl[j++];
        }
        else
        {
            lenb++;
            cin >> boy[z++];
        }
    }
    for (i = 0; i < lenb - 1; i++)
        for (j = 0; j < lenb - 1 - i; j++)
        {
            if (boy[j] > boy[j + 1])
            {
                temp = boy[j]; boy[j] = boy[j + 1]; boy[j + 1] = temp;
            }
        }
    
    for (i = 0; i < leng - 1; i++)
        for (j = 0; j < leng - 1 - i; j++)
        {
            if (girl[j] < girl[j + 1])
            {
                temp = girl[j]; girl[j] = girl[j + 1]; girl[j + 1] = temp;
            }
        }
    cout << fixed;
    for (i = 0; i < lenb; i++)
        cout << setprecision(2) << boy[i] << ' ';
    for (i = 0; i < leng - 1; i++)
        cout << setprecision(2) << girl[i] << ' ';
    
    cout << setprecision(2) << girl[i];
    
    return 0;
}
int main(){
	int n,i,k,malenum=0;
	double h0[40],hmale[40],hfe[40],e;
	char stu0[40][10],male[5]="male";
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s%lf",stu0[i],&h0[i]);
		hmale[i]=100;
		hfe[i]=0;
		if(strcmp(stu0[i],male)==0){
			hmale[i]=h0[i];
			malenum++;
		}else{
			hfe[i]=h0[i];
		}
	}
	for(k=1;k<=n;k++){
		for(i=0;i<n-k;i++){
			if(hmale[i]>hmale[i+1]){
				e=hmale[i+1];
				hmale[i+1]=hmale[i];
				hmale[i]=e;
			}
		}
	}
	for(i=0;i<malenum;i++){
		printf("%.2lf ",hmale[i]);
	}
	for(k=1;k<=n;k++){
		for(i=0;i<n-k;i++){
			if(hfe[i]<hfe[i+1]){
				e=hfe[i+1];
				hfe[i+1]=hfe[i];
				hfe[i]=e;
			}
		}
	}
	for(i=0;i<n-malenum-1;i++){
		printf("%.2lf ",hfe[i]);
	}
	printf("%.2lf",hfe[n-malenum-1]);
	return 0;
}
int main()
{
	int i,n,b,a,j=0;
	double c;
	struct point
	{
		char sx[10];
		double s;
	}
	pl[40],pa[40];
	scanf("%d",&n);
	b=n-1;
	for(i=0;i<n;i++)
	{
	     scanf("%s",&pl[i].sx);
		 scanf("%lf",&pl[i].s);
	}
	for(i=0;i<n;i++)
	{
			if(strcmp(pl[i].sx,"male")==0)
			{
				pa[j]=pl[i];
				j++;
			}
			if(strcmp(pl[i].sx,"female")==0)
			{
				pa[b]=pl[i];
				b--;
			}
	}
	for(i=1;i<=j;i++)
	{
		for(a=0;a<j-i;a++)
		{
				if(pa[a].s>pa[a+1].s)
				{
					c=pa[a].s;
					pa[a].s=pa[a+1].s;
					pa[a+1].s=c;
				}
		}
	}
	for(i=1;i<=n-j;i++)
	{
		for(a=0;a<n-i-j;a++)
		{
				if(pa[a+j].s<pa[a+j+1].s)
				{
					c=pa[a+j].s;
					pa[a+j].s=pa[a+j+1].s;
					pa[a+j+1].s=c;
				}
		}
	}
	for(i=0;i<n;i++)
	{
		if(i!=n-1)
	     printf("%.2lf ",pa[i].s);
		else
	     printf("%.2lf",pa[i].s);
	}
	return 0;
}
int main()
{
	int n, i, p, j = 0, k = 0;
	double tempHeight;
	cin >> n;
	struct student
	{
		char sex[7];
		double height;
	}student[41];

	int count = 0;
	double maleHeight[41] = {0}, femaleHeight[41] = {0}; 
	for(i = 0; i < n; i++)
	{	
		cin >> student[i].sex >> student[i].height;
		if(student[i].sex[0] == 'm')	
			count++;
	}

	for(i = 0; i < n; i++)
	{
		if(student[i].sex[0] == 'm')
			maleHeight[i] = student[i].height;
		if(student[i].sex[0] == 'f')
			femaleHeight[i] = student[i].height;
	}

	for(i = 0; i < n - 1; i++)
	{	
		for(p = 0; p < n - 1 - i; p++)
		{
			if(maleHeight[p] > maleHeight[p + 1])
			{
				tempHeight = maleHeight[p];
				maleHeight[p] = maleHeight[p + 1];
				maleHeight[p + 1] = tempHeight;
			}
		}
	}
	for(i = 0; i <= n - 1; i++)
	{
		for(p = 0; p <= n - 1 - i; p++)
		{
			if(femaleHeight[p] < femaleHeight[p + 1])
			{
				tempHeight = femaleHeight[p];
				femaleHeight[p] = femaleHeight[p + 1];
				femaleHeight[p + 1] = tempHeight;
			}
		}
	}

	cout << fixed;
	for(i = 0; i < n; i++)
	{
		if(maleHeight[i] != 0)
		{
			j = i;
			cout << setprecision(2) << maleHeight[j];
			break;
		}
	}
	for(i = j + 1; i < n; i++)
	{
		if(maleHeight[i] != 0)
			cout << setprecision(2) << " " << maleHeight[i];
	}
	for(i = 0; i < n; i++)
	{
		if(femaleHeight[i] != 0)
			cout << setprecision(2) << " " << femaleHeight[i];
	}	
	return 0;
}
int cmp1(const void * e1,const void * e2){
	if(*((double *)e1)<*((double *)e2))
		return -1;
	else if(*((double *)e1)>*((double *)e2))
		return 1;
	else return 0;
}
int cmp2(const void * e1,const void * e2){
	if(*((double *)e1)<*((double *)e2))
		return 1;
	else if(*((double *)e1)>*((double *)e2))
		return -1;
	else return 0;
}
int main(){
	int n;
	double male[50],female[50];
	int n1,n2;
	double num;
	n1=0;
	n2=0;
	char s[15];
	cin>>n;
	for(int i=0;i<n;++i){
		
		cin>>s>>num;
		if(strcmp(s,"male")==0){
			male[n1]=num;
			n1++;
		}
		else{
			female[n2]=num;
			n2++;
		}
	}
	qsort(male,n1,sizeof(double),cmp1);
	qsort(female,n2,sizeof(double),cmp2);
	for(int i=0;i<n1;++i)
		printf("%.2f ",male[i]);
	for(int i=0;i<n2-1;++i)
		printf("%.2f ",female[i]);
	printf("%.2f",female[n2-1]);
	cout<<endl;
	
}
int main ()
{
	int n, i, bb=0,gg=0;
	char str[10];
	double b[41], g[41];
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> str;
		if (str[0] == 'm')
		{
			bb++;
			cin >> b[bb];
		}
		if (str[0] == 'f')
		{
			gg++;
			cin >> g[gg];
		}
	}
	int j;
	double t;
	for (i =1; i <= bb-1; i++)
	{
		for (j =1; j <= bb - i; j++)
		{
			if (b[j] > b[j+1])
			{
				t = b[j];
				b[j] = b[j+1];
				b[j+1] = t;
			}
		}
	}

	for (i = 1; i <= bb; i++)
		cout << fixed << setprecision(2) << b[i] << " ";
	for (i =1; i <= gg-1; i++)
	{
		for (j =1; j <= gg - i; j++)
		{
			if (g[j] < g[j+1])
			{
				t = g[j];
				g[j] = g[j+1];
				g[j+1] = t;
			}
		}
	}
	for (i = 1; i <= gg; i++)
	{
		if (i < gg)
			cout << fixed << setprecision(2) << g[i] << " ";
		else
			cout << fixed << setprecision(2) << g[i];
	}
	return 0;
}
int main()
{
    char a[40][8];
    double height;
    double female[40];
    double male[40];
    int n;
    double temp;
    int j, k;
    int femalecount = 0;
    int malecount = 0;
    int i;
    cin >>n;
    for (i = 0; i < n; i++)
    {
         cin >> a[i];
         cin >> height;
         if (a[i][0] == 'f')
         {
             female[femalecount] = height;
             femalecount++;
         }
         else
         {
             male[malecount] = height;;
             malecount++;
         }
    }
    for (j = 0; j < malecount; j++)
    {
        for ( k = 0; k < malecount - j - 1; k++)
        {
            if (male[k] > male[k + 1])
            {
                temp = male[k + 1];
                male[k + 1] = male[k];
                male[k] = temp;
            }
        }
    }
    for (j = 0; j < femalecount; j++)
    {
        for ( k = 0; k < femalecount - j - 1; k++)
        {
            if (female[k] < female[k + 1])
            {
                temp = female[k + 1];
                female[k + 1] = female[k];
                female[k] = temp;
            }
        }
    }
    for (j = 0; j < malecount; j++)
    {
        cout << fixed << setprecision(2);
        cout << male[j] << " ";
    }
    for (j = 0; j < femalecount - 1; j++)
    {
        cout << female[j] << " ";
    }
    cout << female[femalecount - 1];
    return 0;
}
int  main(){
	int n,i,max,j,k,a,b;
	char sex[6];
	double he,mahe[40],fehe[40],e;
	scanf("%d",&n);
	for(i=0,j=0,k=0;i<n;i++){
		char sex[6]={0};
		he=0;
		scanf("\n");
		scanf("%s",sex);
		scanf("%lf",&he);
		if(sex[0]=='m'){
             mahe[j]=he;
			 j++;
		}else{
			if(sex[0]=='f'){
				fehe[k]=he;
				k++;
			}
		}
	}
	for(a=1;a<j;a++){
		for(b=0;b<j-a;b++){
			if(mahe[b]>mahe[b+1]){
                  e=mahe[b];
				  mahe[b]=mahe[b+1];
				  mahe[b+1]=e;
			}
		
		}
	}
	for(a=1;a<k;a++){
		for(b=0;b<k-a;b++){
			if(fehe[b]<fehe[b+1]){
                  e=fehe[b];
				  fehe[b]=fehe[b+1];
				  fehe[b+1]=e;
			}
		
		}
	}
	printf("%.2lf",mahe[0]);
	for(i=1;i<j;i++){
	printf(" %.2lf",mahe[i]);
	}
	printf(" %.2lf",fehe[0]);
	for(i=1;i<k;i++){
	printf(" %.2lf",fehe[i]);
	}
    return 0;


}
int main(){
	int n,j,i,i1=0,i2=0,t1,t2;
	struct heying{
		char sex[10];
		double h;
	}heying[N],ex,male[N],fe[N];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s%lf",heying[i].sex,&heying[i].h);
        if(heying[i].sex[0]=='m')
		{
			male[i1]=heying[i];
			i1++;
		}
		else
		{
			fe[i2]=heying[i];
			i2++;
		}
	}
	t1=i1;
	t2=i2;
	for(i=0;i<t1;i++)
	{
		for(j=i+1;j<t1;j++)
		{
			if(male[i].h>male[j].h)
			{
				ex=male[i];
				male[i]=male[j];
				male[j]=ex;
			}
		}
	}
	for(i=0;i<t2;i++)
	{
		for(j=i+1;j<t2;j++)
		{
			if(fe[i].h<fe[j].h)
			{
				ex=fe[i];
				fe[i]=fe[j];
				fe[j]=ex;
			}
		}
	}
	for(i=0;i<t1;i++)
	{
		printf("%.2lf ",male[i].h);
	}
	for(i=0;i<t2-1;i++)
	{
		printf("%.2lf ",fe[i].h);
	}
	printf("%.2lf\n",fe[t2-1].h);
	return 0;
}
main()
{
    int n,i,j,x=0;
    float r;
    float m[40]={0},f[40]={0};
    struct person
    {
        char gender[7];
        float height;
    }person[40];
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%s%f",person[i].gender,&person[i].height);
    for(i=0;i<n;i++)
    {
        if(strlen(person[i].gender)==4) m[i]=person[i].height;
        else f[i]=person[i].height;
    }
    for(i=0;i<40;i++)
    {
        for(j=40-1;j>i;j--)
            if(m[i]>m[j])
            {r=m[i];m[i]=m[j];m[j]=r;}
    }
        for(i=0;i<40;i++)
    {
        for(j=40-1;j>i;j--)
            if(f[i]<f[j])
            {r=f[i];f[i]=f[j];f[j]=r;}
    }
    i=0;
    do{i++;}while(m[i]==0);
    printf("%.2f",m[i]);
    x=i;
    for(i=x+1;i<40;i++) printf(" %.2f",m[i]);
    i=0;
    while(f[i]!=0)
    {
        printf(" %.2f",f[i]);
        i++;
    }
}
int main()
{
	int n,boy,girl,i,j;
	double h[50],b[50],g[50],e;
	char gender[10];
	 scanf("%d",&n);
	 boy=0;
	 girl=0;
	for(i=0;i<n;i++)
	{	
      scanf("%s%lf",gender,&h[i]);
	  if(gender[0]=='m')
	  {
		  b[boy]=h[i];
		  boy++;
	  }
	  else if(gender[0]=='f')
	  {
		  g[girl]=h[i];
		  girl++;
	  }
	}

 	 for(i=0;i<boy;i++)
	{
		 for(j=0;j<boy-1;j++)
		 {
		 if(b[j]>b[j+1])
		 {
			 e=b[j];
			 b[j]=b[j+1];
			 b[j+1]=e;
		 }
		 }
	 }
	 for(i=0;i<girl;i++)
	{
		 for(j=0;j<girl-1;j++)
		 {
		 if(g[j]<g[j+1])
		 {
			 e=g[j];
			 g[j]=g[j+1];
			 g[j+1]=e;
		 }
		 }
	 }
	 printf("%.2lf",b[0]);
	  for(i=1;i<boy;i++)
	{
		  printf(" %.2lf",b[i]);
	  }
	 for(i=0;i<girl;i++)
	{
		  printf(" %.2lf",g[i]);
	  }



return 0;
}
int main(){
	int n,i,j=0,k;
	int a1,b1;
	char an[40][7],x;
	x=' ';
	float bn[40],dn[40],max1=0,max2=0;
	scanf("%d",&n);
	k=n-1;
	for(i=0;i<n;i++)
		scanf("%s%f",an[i],&bn[i]);
	for(i=0;i<n;i++){
		if(strcmp(an[i],"male\0")==0){
			dn[j]=bn[i];
			j+=1;
		}
		if(strcmp(an[i],"female\0")==0){
			dn[k]=bn[i];
			k-=1;
		}
	}
	for(i=j-1;i>=0;i--){
		for(a1=0;a1<i;a1++){
			if(dn[a1]>dn[a1+1]){
				max1=dn[a1];
				dn[a1]=dn[a1+1];
				dn[a1+1]=max1;
			}
		}
	}
	for(i=k+1;i<=n-1;i++){
		for(b1=n-1;b1>i;b1--){
			if(dn[b1]>dn[b1-1]){
				max2=dn[b1];
				dn[b1]=dn[b1-1];
				dn[b1-1]=max2;
			}
		}
	}
	printf("%.2f",dn[0]);
	for(i=1;i<n;i++)
		printf("%c%.2f",x,dn[i]);
	return 0;
}
int main()
{
	int n,i,j=0,k=0,p;
	double arr[40],h1[40],h2[40],t;
	char s[2][10]={"male","female"},s1[40][10];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>s1[i]>>arr[i];
	}
	for(i=0;i<n;i++)
	{
		if(strcmp(s1[i],s[0])==0)
		{
			h1[j]=arr[i];
			j++;
		}
		else
		{
			h2[k]=arr[i];
			k++;
		}
	}
	for(i=1;i<j;i++)
	{
		for(p=0;p<j-i;p++)
		{
			if(h1[p]>h1[p+1])
			{
				t=h1[p];
				h1[p]=h1[p+1];
				h1[p+1]=t;
			}
		}
	}
	for(i=1;i<k;i++)
	{
		for(p=0;p<k-i;p++)
		{
			if(h2[p]<h2[p+1])
			{
				t=h2[p];
				h2[p]=h2[p+1];
				h2[p+1]=t;
			}
		}
	}
	for(i=0;i<j;i++)
	{
		cout<<fixed<<setprecision(2)<<h1[i]<<" ";
	}
	for(i=0;i<k-1;i++)
	{
		cout<<fixed<<setprecision(2)<<h2[i]<<" ";
	}
	cout<<fixed<<setprecision(2)<<h2[k-1];
	return 0;
}
int main()
{
	int n, m, f, i, j;
	m = f = 0;
	char sex[50][10];
	double hm[40], hf[40], t;
	cin >> n;
	for(i = 0; i < n; i++)
	{
		cin >> sex[i];	
		if(sex[i][0] == 'm')
		{
			cin >> hm[m];
			m++;
		}
		else
		{
			cin >> hf[f];
			f++;
		}
	}
	for(i = 0; i <= m - 1; i++)
	{
	for(j = 0; j <= m - i - 2; j++)
	{
		if(hm[j] < hm [j+1])
		{
			t = hm[j+1];
			hm[j+1] = hm[j];
			hm[j] = t;
		}
	}
	}
	for(i = 0; i <= f - 1; i++)
	{
	for(j = 0; j <= f - i - 2; j++)
	{
		if(hf[j] < hf[j+1])
		{
			t = hf[j+1];
			hf[j+1] = hf[j];
			hf[j] = t;
		}
	}
	}
	for(int k = m-1; k >= 0; k--)
		cout << fixed << setprecision(2) << hm[k] << " ";
	for(int l = 0; l < f-1; l++)
		cout << fixed << setprecision(2) << hf[l] << " ";
	cout << fixed << setprecision(2) << hf[f-1] << endl;

	return 0;
}
int main(){
	int n,i,j,k,g,h,p,q;
	float a[40],m[40],f[40],e;
	char s[7];

	scanf("%d",&n);

	g=0;
	h=0;
	for(i=0;i<n;i++){
		scanf("%s %f",s,&a[i]);
		if(s[0]=='m'){
			m[g]=a[i];
			g++;
		}
		else{
			f[h]=a[i];
			h++;
		}
	}

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

	for(p=1;p<=h;p++){
		for(q=0;q<h-p;q++){
			if(f[q]<f[q+1]){
				e=f[q+1];
				f[q+1]=f[q];
				f[q]=e;
			}
		}
	}

	for(j=0;j<g;j++){
		printf("%.2f ",m[j]);
	}
	for(q=0;q<h;q++){
		if(q!=h-1){
			printf("%.2f ",f[q]);
		}
		else{
			printf("%.2f",f[q]);
		}
	}

	return 0;
}
struct in
{
       float h;
}nan[41],nv[41];
int cmp1 (const void *a,const void *b)
{
    struct in *c=(struct in *)a;
    struct in *d=(struct in *)b;
    return ((c->h-d->h)>0)?1:-1;
}
int cmp2 (const void *a,const void *b)
{
    struct in *c=(struct in *)a;
    struct in *d=(struct in *)b;
    return ((-c->h+d->h)>0)?1:-1;
}

int main()
{
    int num;
    int i;
    char ssex[10]={'\0'};
    float hh;
    int numnan=0;
    int numnv=0;
    memset(nan,0,41);
    memset(nv,0,41);
    scanf("%d",&num);
    for (i=0;i<num;i++)
    {
        scanf("%s %f",ssex,&hh);
        if (strcmp(ssex,"male")==0)
        {
           nan[numnan].h=hh;
           numnan++;
        }
        else
        {
            nv[numnv].h=hh;
            numnv++;
        }
        memset(ssex,'\0',10);
    }
    qsort(nan,numnan,sizeof(nan[0]),cmp1);
    qsort(nv,numnv,sizeof(nv[0]),cmp2);
    for (i=0;i<numnan;i++)
    {
        printf("%.2f ",nan[i].h);
    }
    for (i=0;i<numnv;i++)
    {
        if (i!=numnv-1)
           printf("%.2f ",nv[i].h);
        else
            printf("%.2f\n",nv[i].h);
    }
       return 0;
}
int main(void)
{
   int n,i;
   float m[50],f[50],heigh;
   int mm=0;
   int fm=0;
   char name[10];
   int k;
   float temp;
   scanf("%d",&n);
   for(i=0;i<n;i++)
   {
        scanf("%s %f",name,&heigh);
        if(name[0]=='m')
		{
		      m[mm]=heigh;
			  k=mm;
			  while((m[k]<m[k-1])&&k>0)
              {   
			        temp=m[k];
					m[k]=m[k-1];
                    m[k-1]=temp;
					k--;
			  }
			  mm++;
		}
		else
		{
			  f[fm]=heigh;
			  k=fm;
			  while((f[k]<f[k-1])&&k>0)
              {   
			        temp=f[k];
					f[k]=f[k-1];
                    f[k-1]=temp;
					k--;
			  }
              fm++;
		}
   }
   for(i=0;i<mm;i++)
	   printf("%.2f ",m[i]);
   for(i=fm-1;i>0;i--)
       printf("%.2f ",f[i]);
   printf("%.2f\n",f[0]);
   return 0;
}
int main(){
    int n,i,p=-1,q=-1,k;
    float a[40],c[40],d[40],g;
    char b[41][10];
    scanf("%d",&n);
    for(i=0;i<n;i++){
            scanf("%s %f",b[i],&a[i]);
    }
    for(i=0;i<n;i++){
             if(b[i][0]=='m'){
                 p=p+1;
                 c[p]=a[i];
             }else{
                 q=q+1;
                 d[q]=a[i];
             }
    }
    for(k=1;k<=p+1;k++){
            for(i=0;i<p+1-k;i++){
                    if(c[i]>c[i+1]){
                         g=c[i];
                         c[i]=c[i+1];
                         c[i+1]=g;
                    }
            }
     }
     for(k=1;k<=q+1;k++){
            for(i=0;i<q+1-k;i++){
                    if(d[i]<d[i+1]){
                         g=d[i];
                         d[i]=d[i+1];
                         d[i+1]=g;
                    }
            }
     }
     for(i=0;i<=p;i++){
           printf("%.2f ",c[i]);
     }
     for(i=0;i<=q;i++){
          if(i!=q){
           printf("%.2f ",d[i]);
          }else{
           printf("%.2f",d[i]);
          }
     }
     return 0;
}
void sort(float *p1,float *p2,int cri){//cri:1±íê&#190;&#196;D?&#172;-1±íê&#190;&#197;&#174; 
	if((*p1-*p2)*cri>0){
		float temp=*p1;
		*p1=*p2;
		*p2=temp;
	}
}

int main(){
	int k,boynum,b,g;
	b=0;
	g=0;
	float tempheight;
	char tempsex[7];
	scanf("%d",&k);
	float boy[k];
	float girl[k];
	for(int i=1;i<=k;i++){
		scanf("%s %f",tempsex,&tempheight);
		if(strcmp(tempsex,"male\0")==0){
			boy[b]=tempheight;
			b++;
		}
		else{
			girl[g]=tempheight;
			g++;
		}
		
		if(i==k){
			boynum=b;
		}
	}
	for(int i=1;i<=boynum-1;i++){
		for(int j=i+1;j<=boynum;j++){
			sort(&boy[i-1],&boy[j-1],1);
		}
	}
	for(int i=1;i<=k-boynum-1;i++){
		for(int j=i+1;j<=k-boynum;j++){
			sort(&girl[i-1],&girl[j-1],-1);
		}
	}
	printf("%.2f",boy[0]);
	for(int i=2;i<=boynum;i++){
		printf(" %.2f",boy[i-1]);
	}
	for(int i=1;i<=k-boynum;i++){
		printf(" %.2f",girl[i-1]);
	}
	 
}
int main()
{
	int m;
	char sex[10];
	char fmale[10]="male";
	float a;
	int male=0;
	int famle=0;
	float humanm[40];
	float humanf[40];

	cin>>m;
	for(int i=0;i<m;i++)
	{
		cin>>sex>>a;
		if(strcmp(sex,fmale)==0)
		{	
			
			humanm[male]=a;
			male++;
		}
		else
		{
			
			humanf[famle]=a;
			famle++;
		}
	}
	sort(&humanm[0],&humanm[male]);
	sort(&humanf[0],&humanf[famle]);
	for(int i=0;i<male;i++)
		printf("%.2f ",humanm[i]);
	for(int i=famle-1;i>0;i--)
		printf("%.2f ",humanf[i]);
	printf("%.2f\n",humanf[0]);
}
int main()
{
    int n,i,j;
    double a[40],b[40],c[40],q;
    char xb[40][10];
    char str1[]="male",str2[]="female";
    scanf("%d",&n);
    int t=0,k=0;
    for(i=0;i<n;i++){
                     scanf("%s%lf",xb[i],&c[i]);
                     if(strcmp(xb[i],str1)==0){
                                       a[k]=c[i];
                                       k++;
                                       }
                     if(strcmp(xb[i],str2)==0){
                                         b[t]=c[i];
                                         t++;
                                         }
                                         }
    for(i=1;i<k;i++){
                     for(j=0;j<k-i;j++){
                                        if(a[j]>a[j+1]){
                                                        q=a[j];
                                                        a[j]=a[j+1];
                                                        a[j+1]=q;
                                                        }
                                        }
                                        }
     for(i=1;i<t;i++){
                     for(j=0;j<t-i;j++){
                                        if(b[j]<b[j+1]){
                                                        q=b[j];
                                                        b[j]=b[j+1];
                                                        b[j+1]=q;
                                                        }
                                        }
                                        }
     for(i=0;i<k;i++)
     printf("%.2lf ",a[i]);
     for(i=0;i<t-1;i++)
     printf("%.2lf ",b[i]);
     printf("%.2lf",b[t-1]);
     return 0;
     }