#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b;
  cin >> a >> b;
  int pa = 0;
  while (pa + 1 < a.size() && a[pa + 1] < b[0]) pa++;
  for (int i = 0; i <= pa; i++) cout << a[i];
  cout << b[0];
}
