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

bccdb
 z
 dfdeed
 aab
 y
 abac

#include <bits/stdc++.h>
char a[300002], b[300002], c[300002];
int main() {
  scanf("%s%s", a, b);
  int n = strlen(a), sa = 0, sb = 0;
  int ea, eb;
  std::sort(a, a + n);
  std::sort(b, b + n);
  std::reverse(b, b + n);
  if (n % 2 == 1)
    ea = n / 2, eb = n / 2 - 1;
  else
    ea = eb = n / 2 - 1;
  a[ea + 1] = b[eb + 1] = 0;
  puts(a);
  puts(b);
  int i, s = 0, e = n - 1, cnt = 0;
  while (cnt < n) {
    if (~cnt & 1) {
      if (a[sa] > b[sb])
        c[e--] = a[ea--];
      else
        c[s++] = a[sa++];
      ++cnt;
    } else {
      if (b[sb] < a[sa])
        c[e--] = b[eb--];
      else
        c[s++] = b[sb++];
      ++cnt;
    }
  }
  c[n] = 0;
  printf("%s", c);
  return 0;
}
