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