#include <bits/stdc++.h>
using namespace std;
int a, b, n, l, h;
set<int> st;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string f, l;
  cin >> f >> l;
  cout << f[0];
  for (int i = 1; i < f.length(); ++i) {
    if (f[i] >= l[0])
      break;
    else
      cout << f[i];
  }
  cout << l[0];
  return 0;
}
