#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
template <typename T, typename U>
inline bool EQ(const T &a, const U &b) {
  return (abs(a - b) <= 1e-9);
}
int main() {
  cin.tie(0);
  cout.tie(0);
  string a, b;
  cin >> a >> b;
  string ans = "";
  ans += a[0];
  bool done = 0;
  int bs = b.size();
  int as = a.size();
  int bi = 0;
  if (as == 1) {
    ans += b[0];
    cout << ans;
    return 0;
  }
  int ai = 1;
  while (!done && ai < as && bi < bs) {
    if (b[bi] <= a[ai]) {
      ans += b[bi];
      done = 1;
    } else {
      ans += a[ai];
      ++ai;
    }
  }
  if (!done) {
    ans += b[0];
  }
  cout << ans;
  return 0;
}
