#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string a, b;
  cin >> a >> b;
  int n = a.size();
  int m = b.size();
  char f = a[0];
  char h = b[0];
  string s = "";
  s = s + a[0];
  s = s + b[0];
  for (int i = 1; i < n; i++) {
    string x = "";
    x = x + a[0];
    for (int j = 1; j < i + 1; j++) {
      x = x + a[j];
    }
    x = x + b[0];
    if (x < s) s = x;
  }
  cout << s;
  return 0;
}
