bcdef
abbbc
 z
y
 reddit
abcdef
 abc
aaa
 y
z
 cbxz
aaaa

bccdb
 z
 dfdeed
 aab
 y
 abac

#include <bits/stdc++.h>
using namespace std;
int dcmp(double x, double y) {
  return (fabs((x) - (y)) <= 1e-9) ? 0 : ((x) < (y)-1e-9) ? -1 : 1;
}
map<char, int> olg, igr, olgf, igrf;
string s1, s2;
char ans[300008];
char smallestInOlg() {
  for (pair<char, int> p : olgf) {
    if (p.second > 0) return p.first;
  }
  return 'A';
}
char largestWithIgr() {
  for (char i = 'z'; i >= 'a'; i--) {
    if (igrf[i]) return i;
  }
  return 'A';
}
int main(void) {
  cin >> s1 >> s2;
  for (char c : s1) {
    olg[c]++;
  }
  for (char c : s2) {
    igr[c]++;
  }
  int n = s1.length();
  int olgT = (n + 1) / 2;
  int igrT = n - olgT;
  for (pair<char, int> p : olg) {
    if (olgT) {
      int can = min(p.second, olgT);
      olgf.insert(make_pair(p.first, can));
      olgT -= min(p.second, olgT);
    } else {
      break;
    }
  }
  olgT = n - igrT;
  for (char i = 'z'; i >= 'a'; --i) {
    if (igrT) {
      int can = min(igr[i], igrT);
      igrf.insert(make_pair(i, can));
      igrT -= min(igr[i], igrT);
    } else {
      break;
    }
  }
  igrT = n - olgT;
  bool isF = true;
  int filled = 1;
  while (filled <= n) {
    if (isF) {
      int start = filled;
      char smallestWithMe = smallestInOlg();
      map<char, int> needed;
      for (pair<char, int> p : igrf) {
        if ((p.first < smallestWithMe || smallestWithMe == 'A') && p.second) {
          needed.insert(make_pair(p.first, p.second));
          filled += p.second;
          igrf[p.first] = 0;
        }
      }
      for (char c = 'z'; c >= 'a'; c--) {
        int cnt = needed[c];
        while (cnt--) ans[start++] = c;
      }
      if (smallestWithMe != 'A') {
        filled++;
        ans[start] = smallestWithMe;
        olgf[smallestWithMe]--;
      }
      isF = false;
    } else {
      int start = filled;
      char largestWithMe = largestWithIgr();
      map<char, int> needed;
      for (pair<char, int> p : olgf) {
        if ((p.first > largestWithMe || largestWithMe == 'A') && p.second) {
          needed.insert(make_pair(p.first, p.second));
          filled += p.second;
          olgf[p.first] = 0;
        }
      }
      for (char c = 'a'; c <= 'z'; c++) {
        int cnt = needed[c];
        while (cnt--) ans[start++] = c;
      }
      if (largestWithMe != 'A') {
        filled++;
        ans[start] = largestWithMe;
        igrf[largestWithMe]--;
      }
      isF = true;
    }
  }
  for (int(i) = (1); i <= (int)(n); (i)++) {
    cout << ans[i];
  }
}
