#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vii;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s, s1;
  cin >> s >> s1;
  int j = s.size();
  int k1 = s1[0];
  for (long long i = 1; i < s.size(); i++) {
    int k = s[i];
    if (k >= k1) {
      j = i;
      break;
    }
  }
  for (long long i = 0; i < j; i++) {
    cout << s[i];
  }
  cout << s1[0];
  return 0;
}
