#include <bits/stdc++.h>
using namespace std;
int main() {
  string p, q;
  cin >> p >> q;
  char v = q[0];
  string s;
  s.push_back(p[0]);
  for (int i = 1; i < p.size(); i++) {
    if (p[i] < v) {
      s.push_back(p[i]);
    } else
      break;
  }
  s.push_back(v);
  cout << s;
}
