#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int n = a.length();
  int m = b.length();
  int t = 0;
  int l = 1, r = 0;
  cout << a[0];
  while (t == 0 && l < n && r < m) {
    if (a[l] < b[r]) {
      cout << a[l];
      l++;
    } else {
      cout << b[r];
      t = 1;
    }
  }
  if (l == n) {
    cout << b[r];
  }
  return 0;
}
