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