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