#include <bits/stdc++.h>
using namespace std;
string s1, s2, rj;
int main() {
  cin >> s1 >> s2;
  rj += s1[0];
  s1 += 'z';
  int i = 1;
  while (s2[0] > s1[i]) {
    rj += s1[i];
    i++;
  }
  rj += s2[0];
  cout << rj;
}
