#include <bits/stdc++.h>
using namespace std;
string a, b, s;
int main() {
  cin >> a >> b;
  int n = a.size();
  int m = b.size();
  s = a + b;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      string t = a.substr(0, i) + b.substr(0, j);
      s = min(s, t);
    }
  cout << s << endl;
  return 0;
}
