#include
#include
int main(){
char *a=(char*)malloc(sizeof(char));
gets(a);
char *b=(char*)malloc(sizeof(char));
gets(b);
char *c=(char*)malloc(sizeof(char));
gets (c);
char temp;
for(int i=0;i<3;i++){
for(int j=i+1;j<3;j++){
if(a[i]>a[j]){
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(int i=0;i<3;i++){
for(int j=i+1;j<3;j++){
if(b[i]>b[j]){
temp=b[i];
b[i]=b[j];
b[j]=temp;
}
}
}
for(int i=0;i<3;i++){
for(int j=i+1;j<3;j++){
if(c[i]>c[j]){
temp=c[i];
c[i]=c[j];
c[j]=temp;
}
}
}
puts(c);
puts(b);
puts(a);
free(a);
free(b);
free(c);
return 0;
}