#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int n = s1.length();
  int m = s2.length();
  vector<string> vec;
  string s;
  for (int i = 0; i < n; i++) {
    s += s1[i];
    string s4;
    for (int j = 0; j < m; j++) {
      s4 += s2[j];
      string s3 = s + s4;
      vec.push_back(s3);
    }
  }
  sort(vec.begin(), vec.end());
  cout << vec[0] << endl;
}
