#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 3, M = 1e5 + 3, BIG = 1e9 + 3, MOD = 1e9 + 7, P = 'z' - 'a' + 1,
          K = 4;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string a, b;
  cin >> a >> b;
  cout << a[0];
  for (int i = 1; i < a.size(); ++i)
    if (a[i] < b[0])
      cout << a[i];
    else
      break;
  cout << b[0];
  return 0;
}
