#include <bits/stdc++.h>

using namespace std;

//char Intput[] = {"0123456789abcdefABCDEF"}; //输入参照字典(数字 + 大小写字母)
//int Output[] = "084c2a6e195d3b7f5d3b7f"; //输出参照字典(小写)
//char Output[] = {"084C2A6E195D3B7F5D3B7F"}; //输出参照字典(数字 + 大写字母)
unordered_map<char, char> mp = {
    {'0', '0'},  {'1', '8'},  {'2', '4'},  
    {'3', 'C'},  {'4', '2'},  {'5', 'A'},  
    {'6', '6'},  {'7', 'E'},  {'8', '1'},  
    {'9', '9'},  {'a', '5'},  {'b', 'D'},  
    {'c', '3'},  {'d', 'B'},  {'e', '7'},  
    {'f', 'F'},  {'A', '5'},  {'B', 'D'},  
    {'C', '3'},  {'D', 'B'},  {'E', '7'}, 
    {'F', 'F'}
};

void process(string s1, string s2, string& res){
    //合并
    string s = s1 + s2;
    
    //排序
    string odds = "", evens = "";
    for(int i = 0; i < s.size(); i++){
        if(i % 2 == 0){
            evens += s[i];
        }
        else{
            odds += s[i];
        }
    }
    sort(odds.begin(), odds.end());//cout << odds << endl;
    sort(evens.begin(), evens.end());//cout << evens << endl;   
    int idx = 0; string newS = "";
    while(idx < odds.size() || idx < evens.size()){
        if(idx < evens.size()) newS += evens[idx];
        if(idx < odds.size()) newS += odds[idx];      
        idx++;
    }   
    //cout << newS << endl;
    
    //转换(直接建立哈希表,键为转换前,值为转换后)
    //哈希表中存在进行转换,否则保留原字符
    for(int i = 0; i < newS.size(); i++){
        if(mp.find(newS[i]) != mp.end()){
            newS[i] = mp[newS[i]];
        }
    }   
    
    res = newS;
}

int main(){
    string s1 = "", s2 = "";
    
    while(cin >> s1 >> s2){
        string res = "";
        process(s1, s2, res);
        cout << res << endl;
    }
    
    return 0;
}