#include <stdio.h>
#include <string.h>

int main() {
  int n = 0, m = 0;
  char niz[18];
  char X[10], Y[10];
  scanf("%s", X);
  scanf("%s", Y);
  if (strlen(X) >= strlen(Y)) {
    int k = strlen(X) - strlen(Y);
    for (int i = 0; i < k; i++) {
      niz[i] = X[i];
      n++;
    }
    for (int i = 0; i < strlen(Y); i++) {
      if ((int)(X[i + k]) > (int)(Y[i])) {
        niz[i + m + k] = X[i + k];
        n++;
      } else if ((int)(Y[i]) > (int)(X[i + k])) {
        niz[i + m + k] = Y[i];
        n++;
      } else {
        niz[i + m + k] = Y[i];
        niz[i + m + k + 1] = Y[i];
        n += 2;
        m++;
      }
    }
  } else {
    int k = strlen(Y) - strlen(X);
    for (int i = 0; i < k; i++) {
      niz[i] = Y[i];
      n++;
    }
    for (int i = 0; i < strlen(X); i++) {
      if ((int)(Y[i + k]) > (int)(X[i])) {
        niz[i + m + k] = Y[i + k];
        n++;
      } else if ((int)(X[i]) > (int)(Y[i + k])) {
        niz[i + m + k] = X[i];
        n++;
      } else {
        niz[i + m + k] = X[i];
        niz[i + m + 1 + k] = X[i];
        n += 2;
        m++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%c", niz[i]);
  }
  printf("\n");
  return 0;
}