#include <bits/stdc++.h>
using namespace std;
int main() {
  char first[11];
  char last[11];
  memset(first, 0, sizeof(first));
  memset(last, 0, sizeof(last));
  cin >> first >> last;
  char ret[12];
  *ret = first[0];
  int len = strlen(first);
  int i;
  for (i = 1; i < len; i++) {
    if (first[i] >= last[0]) {
      break;
    }
    *(ret + i) = first[i];
  }
  *(ret + i) = last[0];
  *(ret + i + 1) = '\0';
  cout << ret;
  return 0;
}
