#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 10000005;
string second, t, first = "";
int n;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> second >> t;
  n = second.length();
  first += second[0];
  int i = 1;
  while (second[i] < t[0] && i < n) {
    first += second[i];
    i++;
  }
  first += t[0];
  cout << first;
  return 0;
}
