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