#include <bits/stdc++.h>
using namespace std;
class TaskA {
 public:
  void solve(std::istream& in, std::ostream& out) {
    string name, surname;
    in >> name >> surname;
    string token;
    token.push_back(name[0]);
    for (int i = 1; i < name.size(); ++i) {
      if (name[i] < surname[0]) {
        token.push_back(name[i]);
      } else {
        break;
      }
    }
    token.push_back(surname[0]);
    out << token;
  }
};
int main() {
  TaskA solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
