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