#include <bits/stdc++.h>
using namespace std;
string first, last;
bool comp(string &s1, string &s2) {
  int l1 = (int)s1.length();
  int l2 = (int)s2.length();
  for (int i = 0; i < min(l1, l2); i++) {
    if (s1[i] != s2[i]) return s1[i] < s2[i];
  }
  return l1 < l2;
}
int main() {
  cin >> first >> last;
  int n = (int)first.length();
  int m = (int)last.length();
  vector<string> v;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      string s = first.substr(0, i) + last.substr(0, j);
      v.push_back(s);
    }
  }
  sort(v.begin(), v.end(), comp);
  cout << v[0];
  return 0;
}
