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