#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cctype>
using namespace std;
char change(char c);
int toBin(int n);
int main() {
string str1, str2;
while (cin >> str1 >> str2) {
string s = str1 + str2;//合并
int len = s.length();
string odd;
string even;
for(int i = 0 ; i < len; i++){//奇偶下标分开
if(i & 1) odd.push_back(s[i]);
else even.push_back(s[i]);
}
sort(odd.begin(), odd.end());//奇数下标排序
sort(even.begin(), even.end());//偶数下标排序
string new_s;
int m = 0, n = 0;
for(int i = 0; i < len; i++){//排序后合并
if(i & 1) new_s.push_back(odd[m++]);
else new_s.push_back(even[n++]);
}
for(int i = 0 ; i < len ; i++){//转换处理
new_s[i] = change(new_s[i]);
}
cout << new_s << endl;
}
}
char change(char c){
int num;
if(isdigit(c)){//如果是数字
num = toBin(c - '0');
}else if((c >= 'a' && c <='f') || (c >= 'A' && c <= 'F')){//如果是a~f 或 A~F
if(islower(c)) c = toupper(c);//小写转大写
num = toBin(c - 'A' + 10);
}else{//其他字母不变
return c;
}
if(num <= 9) return num + '0';//处理后结果小于10还原成数字字符
else return num - 10 + 'A';//处理后结果大于10在A的基础上加
}
int toBin(int n){
vector<int> num(4,0);//存储二进制数
int k = 3;
while( n != 0){//取模的数是从低到高,故数组从高到低存(尾到头)
num[k--] = n % 2;
n /= 2;
}
int x = 0;
for(int i = 3; i >= 0; i--){//从低位开始算即翻转
x = 2 * x + num[i];
}
return x;
}