#include <bits/stdc++.h>
using namespace std;
string a, b;
set<string> st;
int main() {
  cin >> a >> b;
  int n = a.length(), m = b.length();
  string s1;
  for (int i = 0; i < n; ++i) {
    s1 += a[i];
    string s2;
    for (int j = 0; j < m; ++j) {
      s2 += b[j];
      st.insert(s1 + s2);
    }
  }
  cout << *st.begin();
}
