#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  cout << a[0];
  for (int e = 1; e < a.size(); e++)
    if (a[e] < b[0])
      cout << a[e];
    else
      break;
  cout << b[0] << endl;
  return 0;
}
