#include <bits/stdc++.h>
using namespace std;
int main() {
  string f, l;
  cin >> f >> l;
  string result;
  result = f[0];
  for (int i = 1; i < f.length(); i++) {
    if (l[0] <= f[i]) {
      break;
    }
    result += f[i];
  }
  result += l[0];
  cout << result << endl;
  return 0;
}
