#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  string ans = "";
  char c = b[0];
  ans += a[0];
  for (int i = 1; i < a.size(); i++) {
    if (a[i] < c)
      ans += a[i];
    else
      break;
  }
  ans += c;
  cout << ans << endl;
  return 0;
}
