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