#include <bits/stdc++.h>
using namespace std;
string name, surname;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cin >> name >> surname;
  char sur = surname[0];
  string res = name + sur, aux = "";
  for (char c : name) {
    aux = aux + c;
    if (aux + sur < res) res = aux + sur;
  }
  cout << res << endl;
}
