#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
/*
思路:左16: 0~9 a~f,右8:表示进位,16进制进行循环移位,
*/
void reverseChar(char &c)
{
unsigned bit_l = 0x08; // 左16: 0~9 a~f, 0X08= 00001000
unsigned bit_r = 0x01; // 右8:进位
char a = 0x00;
// 字符转16进制,进行BIT倒序
while(bit_l) // 循环移位
{
if(c & bit_l) { //若左16位满了,进位
a |= bit_r; // 右8位:表示进1位
}
//假设x=5,那么x的二进制为0101,x>>1表示x右移1位,即把最右边一位的1删掉,变为010,此时x=2;
bit_l >>= 1; // x>>=1等价于x=x>>1
bit_r <<= 1;
}
// 转化16进制
if(a >= 0 && a <= 9) a += '0';
else if(a >= 0x0A && a <= 0x0F) a = a - 0x0A + 'A';
c = a;
}
#ifndef REVERSE_CHAR
string verserString(string strCombine, int strCombineLen)
{
string strOut;
for(int i = 0; i < strCombineLen; i++) {
if(strCombine[i] >= '0' && strCombine[i] <= '9') {
strCombine[i] = strCombine[i] - '0'; //隐式转化int-->char
reverseChar(strCombine[i]);
} else if (strCombine[i] >= 'A' && strCombine[i] <= 'F'){
strCombine[i] = strCombine[i] - 'A' + 10;
reverseChar(strCombine[i]);
} else if (strCombine[i] >= 'a' && strCombine[i] <= 'f'){
strCombine[i] = strCombine[i] - 'a' + 10;
reverseChar(strCombine[i]);
}
}
strOut = strCombine;
return strOut;
}
#else
string verserString(string complileStr, int complileStrLen)
{
//char Intput[] = {"0123456789abcdefABCDEF"}; //输入参照字典(数字 + 大小写字母)
// int Output[] = "084c2a6e195d3b7f5d3b7f"; //输出参照字典(小写)
// string outPut = {"084C2A6E195D3B7F5D3B7F"}; // 16进制bit倒序
string complileStr, oddStr, evenStr;
for(int i = 0; i < complileStrLen; i++) {
if((complileStr[i] >= '0') && (complileStr[i] <= '9')) {
complileStr[i] = outPut[complileStr[i] - '0'];
} else if((complileStr[i] >= 'a') && (complileStr[i] <= 'f')) {
complileStr[i] = outPut[complileStr[i] - 'a' + 10];
} else if((complileStr[i] >= 'A') && (complileStr[i] <= 'F')) {
complileStr[i] = outPut[complileStr[i] - 'A' + 10];
}
}
}
#endif
/*
思路:将2个字符串合并,再根据奇偶性分离,排序后再次奇偶性合并,如果是数字,则将字符转化为数字-》二进制-》反转-》转十进制--》转化字符;
如果大写或小写字符,则转化十进制字-》二进制-》反转-》转十进制--》转化字符;
*/
string CompileString(string strIn1, string strIn2)
{
string strCombine = strIn1 + strIn2;
int strCombineLen = strCombine.size();
string strOdd, strEven;
for(int i= 0; i < strCombineLen; i++) {
if(i % 2 == 0) {
strEven += strCombine[i];
} else {
strOdd += strCombine[i];
}
}
sort(strOdd.begin(), strOdd.end());
sort(strEven.begin(), strEven.end());
int j = 0;
int k = 0;
for(int i= 0; i < strCombineLen; i++) {
if(i % 2 == 0) {
strCombine[i] = strEven[j];
j++;
} else {
strCombine[i] = strOdd[k];
k++;
}
}
return verserString(strCombine, strCombineLen);
}
int main()
{
string str1, str2;
while(cin>>str1>>str2) {
cout<<CompileString(str1, str2)<<endl;
}
return 0;
}