#include <bits/stdc++.h>
using namespace std;
string s, s1, k;
long int i = 1;
int main() {
  cin >> s >> s1;
  k = k + s[0];
  while ((s[i] < s1[0]) && (i < s.length())) {
    k += s[i];
    i++;
  }
  cout << k + s1[0];
}
