#include <bits/stdc++.h>
using namespace std;
int main() {
  string x, xx;
  cin >> x >> xx;
  int i, j, k, l;
  i = 0;
  i++;
  j = 0;
  string y = "";
  char p;
  p = x[0];
  y = y + p;
  while (1) {
    k = x[i];
    l = xx[j];
    if (i == x.length()) {
      y = y + xx[j];
      break;
    } else if (k < l) {
      y = y + x[i];
      i++;
    } else if (k >= l) {
      y = y + xx[j];
      break;
    }
  }
  cout << y << "\n";
  return 0;
}
