#include <bits/stdc++.h>
using namespace std;
map<int, map<float, int> > mp;
int main() {
  string s, s1, as = "";
  cin >> s >> s1;
  int i = 0;
  as += s[i++];
  while (i < s.size() && s[i] < s1[0]) {
    as += s[i];
    i++;
  }
  as += s1[0];
  cout << as << "\n";
}
