import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str=sc.nextLine();
String []st=str.split(" ");
System.out.println(adjust(combine2(combine1(st[0],st[1]))));
}
//第一步合并
private static String combine1(String str1,String str2){
StringBuilder str=new StringBuilder();
for(char ch:str1.toCharArray())
str.append(ch);
for(char ch:str2.toCharArray())
str.append(ch);
return str.toString();
}
//第二步合并
private static String combine2(String str){
char []chs=str.toCharArray();
//取出偶数位排序
char []ch2=new char[str.length()/2];
int j=0;
for(int i=0;i<str.length();i++){
if(i%2!=0)
ch2[j++]=chs[i];
}
Arrays.sort(ch2);
//取出奇数位排序
char []ch1=new char[str.length()-str.length()/2];
int k=0;
for(int i=0;i<str.length();i++)
if(i%2==0)
ch1[k++]=chs[i];
Arrays.sort(ch1);
StringBuilder str1=new StringBuilder();
for(int i=0;i<str.length();i++){
if(i%2==0)
str1.append(ch1[i/2]);
else
str1.append(ch2[i/2]);
}
return str1.toString();
}
//调整阶段
private static String adjust(String str){
StringBuilder ans=new StringBuilder();
char []chs=str.toCharArray();
for(char ch:chs){
if(!((ch>=48&&ch<=57)||(ch>=65&&ch<=70)||(ch>=97&&ch<=102))){
ans.append(ch);
continue;
}
int temp=0;
if((ch>=65&&ch<=70)||(ch>=97&&ch<=102))
//16进制转10进制
temp=Integer.parseInt(String.valueOf(ch),16);
else
temp=Integer.parseInt(String.valueOf(ch));
//10进制转4位二进制
String temp_=Integer.toString(temp,2);
String temp__=String.format("%4s",temp_).replace(' ','0');
//反转二进制
StringBuilder reversed=new StringBuilder();
for(int i=3;i>=0;i--){
reversed.append(temp__.charAt(i));
}
//二进制转16进制
int temp___=Integer.parseInt(reversed.toString(),2);
String hex=Integer.toString(temp___,16);
//转成大写
String heX=hex.toUpperCase();
ans.append(heX);
}
return ans.toString();
}
}