#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  cout << a[0];
  if (a.length() > 1)
    for (int i = 1; i < a.length(); i++) {
      if (a[i] - 'a' < b[0] - 'a') {
        cout << a[i];
      } else {
        break;
      }
    }
  cout << b[0];
}
