#include<bits/stdc++.h>
using namespace std;
int main(){
string str1,str2;
while(cin>>str1>>str2){
string new_str = str1+str2;
if(new_str.size()>2){
//希尔排序
for(int i=2;i<new_str.size();++i){
if(new_str[i]<new_str[i-2]){
char ch = new_str[i];
int j=i-2;
for(j;new_str[j]>ch&&j>=0;j-=2){
new_str[j+2] = new_str[j];
}
new_str[j+2] = ch;
}
}
}
for(int i=0;i<new_str.size();++i){
int num=-1;
if(new_str[i]>='0'&&new_str[i]<='9'){
num = new_str[i]-'0';
}else if(new_str[i]>='A'&&new_str[i]<='F'){
num = new_str[i]-'A'+10;
}else if(new_str[i]>='a'&&new_str[i]<='f'){
num = new_str[i]-'a'+10;
}
if(num>-1){
bitset<4> b1(num);
string tmp = b1.to_string();
reverse(tmp.begin(), tmp.end());
bitset<4> b2(tmp);
int res_num = b2.to_ulong();
if(res_num>=0&&res_num<=9)
new_str[i]='0'+res_num;
else if(res_num>9&&res_num<16)
new_str[i]='A'+res_num-10;
}
}
cout<<new_str<<endl;
}
return 0;
}