#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v;
  int i, j, k, l, l1, l2;
  string a, b, s1, s2, s;
  cin >> a >> b;
  l1 = a.size();
  l2 = b.size();
  for (i = 1; i <= l1; i++) {
    for (j = 1; j <= l2; j++) {
      for (k = 0, s1 = ""; k < i; k++) {
        s1 += a[k];
      }
      for (l = 0, s2 = ""; l < j; l++) {
        s2 += b[l];
      }
      s = s1 + s2;
      v.push_back(s);
    }
  }
  sort(v.begin(), v.end());
  cout << v[0] << endl;
  return 0;
}
