#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s1, s2;
  cin >> s1 >> s2;
  cout << s1[0];
  for (int i = 1; i < s1.length(); i++) {
    if (s1[i] >= s2[0]) break;
    cout << s1[i];
  }
  cout << s2[0];
  return 0;
}
