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