#include <bits/stdc++.h>
using namespace std;
const int maxi = 1e6 + 5;
string s, s1;
int cnt[maxi], ch[maxi], cnt1[maxi], ch1[maxi];
int main() {
  cin >> s >> s1;
  int n = s.size();
  int m = s1.size();
  string ans = "";
  ans = s[0];
  ans += s1[0];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      string ans1 = "";
      for (int k = 0; k <= i; k++) ans1 += s[k];
      for (int k = 0; k <= j; k++) ans1 += s1[k];
      if (ans1 < ans) ans = ans1;
    }
  cout << ans << "\n";
  return 0;
}
