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;
long long read() {
  long long x = 0, y = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') y = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * y;
}
char a[300005], b[300005];
int len;
bool cmp(char x, char y) { return x > y; }
char name[300005];
int main() {
  scanf("%s%s", a, b);
  len = strlen(a);
  name[len] = '\0';
  sort(a, a + len);
  sort(b, b + len, cmp);
  cout << a << endl << b << endl;
  int t1 = 0, t2 = 0, t3 = 0;
  int now = 0;
  while (1) {
    if (!now) {
      if (a[t1] < b[t2]) {
        name[t3++] = a[t1++];
        if (t3 == len) {
          printf("%s", name);
          return 0;
        }
      } else
        break;
    } else {
      if (a[t1] < b[t2]) {
        name[t3++] = b[t2++];
        if (t3 == len) {
          printf("%s", name);
          return 0;
        }
      } else
        break;
    }
    now ^= 1;
  }
  int t4 = len - 1;
  t1 = (len + 1) / 2 - 1, t2 = len / 2 - 1;
  while (1) {
    if (!now) {
      name[t4--] = a[t1--];
      if (t4 < t3) break;
    } else {
      name[t4--] = b[t2--];
      if (t4 < t3) break;
    }
    now ^= 1;
  }
  printf("%s", name);
  return 0;
}
