#include<iostream>#include<algorithm>usingnamespace std;intmain(void){int x[3];char a,b,c;for(int i =0; i <3; i++){
cin>>x[i];}sort(x,x+3);
cin>>a>>b>>c;int t1 = a -'A';int t2 = b -'A';int t3 = c -'A';if(t1 > t2 && t1 > t3){if(t2 > t3){//CBA
cout<<x[2]<<" "<<x[1]<<" "<<x[0]<<endl;}else{//cab
cout<<x[2]<<" "<<x[0]<<" "<<x[1]<<endl;}}elseif(t2 > t3 && t2 > t1){if(t3 > t1){//a c b
cout<<x[0]<<" "<<x[2]<<" "<<x[1]<<endl;}else{//b c a
cout<<x[1]<<" "<<x[2]<<" "<<x[0]<<endl;}}elseif(t3 > t1 && t3 > t2){if(t1 > t2){//b a c
cout<<x[1]<<" "<<x[0]<<" "<<x[2]<<endl;}else{//a b c abc
cout<<x[0]<<" "<<x[1]<<" "<<x[2]<<endl;}}system("PAUSE");return0;}