#include <bits/stdc++.h>
int main() {
  std::string first, last, create = "fffffffffffff";
  int let = 1;
  std::cin >> first >> last;
  create[0] = first[0];
  int size = first.size();
  for (int i = 1; i < size; i++) {
    if (first[i] < last[0]) {
      create[let] = first[i];
      let++;
    } else
      break;
  }
  create[let] = last[0];
  create = create.substr(0, let + 1);
  std::cout << create;
  return 0;
}
