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