#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, m, q, ans;
long long e;
unordered_map<long long, long long> mp;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  mp.reserve(32768);
  mp.max_load_factor(0.25);
  e = abs((rand() << 15) | rand());
  string s, t;
  cin >> s >> t;
  cout << s[0];
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] < t[0]) {
      cout << s[i];
    } else {
      break;
    }
  }
  cout << t[0] << '\n';
  ;
  return 0;
}
