#include <iostream>
#include <string>
#include <set>
using namespace std;
int bitReverse(int num){
if(num == 0){
return 0;
}
int res = 0;
int i = 0;
while(i < 4){
res <<= 1;
res += num & 1;
num >>= 1;
++i;
}
return res;
}
char processChar(char c){
char res;
int num = 0;
if(c >= 'a' && c <= 'f'){
num = bitReverse((int)c - 87);
}
else if(c >= 'A' && c <= 'F'){
num = bitReverse((int)c - 55);
}
else if(c >= '0' && c <= '9'){
num = bitReverse((int)c - 48);
}
else{
return c;
}
if(num >= 0 && num <= 9){
res = (char)num + '0';
}
if(num >= 10 && num <= 15){
res = (char)num + '7';
}
return res;
}
int main(int argc, char* argv[]){
string str1, str2;
cin >> str1 >> str2;
string str = str1 + str2;
multiset<char> evens;
for(int i = 0; i < str.size(); i += 2){
evens.insert(str[i]);
}
multiset<char> odds;
for(int i = 1; i < str.size(); i += 2){
odds.insert(str[i]);
}
int turn = 0;
string res;
while(!evens.empty() && !odds.empty()){
if(turn % 2 == 0){
res.push_back(processChar(*evens.begin()));
evens.erase(evens.begin());
}
else{
res.push_back(processChar(*odds.begin()));
odds.erase(odds.begin());
}
++turn;
}
if(!evens.empty()){
res.push_back(processChar(*evens.begin()));
evens.erase(evens.begin());
}
if(!odds.empty()){
res.push_back(processChar(*odds.begin()));
odds.erase(odds.begin());
}
cout << res << endl;
return 0;
}