#include <bits/stdc++.h>
using namespace std;
string a, b, ans;
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> a >> b;
  int i = 1, j = 0;
  ans += a[0];
  for (int i = 1; i < a.length(); i++) {
    if (a[i] >= b[0])
      break;
    else
      ans += a[i];
  }
  ans += b[0];
  cout << ans;
}
