#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  vector<string> v;
  string S1, S2;
  cin >> S1 >> S2;
  for (int i = 0; i < S1.length(); i++) {
    for (int j = 0; j < S2.length(); j++) {
      string s;
      for (int k = 0; k <= i; k++) s += S1[k];
      for (int l = 0; l <= j; l++) s += S2[l];
      v.push_back(s);
    }
  }
  sort(v.begin(), v.end());
  cout << v[0] << endl;
  return 0;
}
