#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  string c;
  c += a[0];
  int i = 1;
  while (i < (int)a.size() && a[i] < b[0]) {
    c += a[i];
    i++;
  }
  cout << c << b[0];
}
