#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[10000], b[10000], c[10000];
  int i;
  cin >> a >> b;
  c[0] = a[0];
  for (i = 1; a[i] != '\0'; i++) {
    if (a[i] < b[0]) {
      c[i] = a[i];
    } else
      break;
  }
  c[i] = b[0];
  for (int j = 0; c[j] != '\0'; j++) {
    cout << c[j];
  }
  cout << endl;
  return 0;
}
