#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ldb = long double;
const int SMALLINF = 1e9 + 7;
const ll BIGINF = ((ll)1e18) + 7;
void solve() {
  string firstn, secondn, res = "";
  cin >> firstn >> secondn;
  res += firstn[0];
  for (ll i = (1); i <= ((int)(firstn).size() - 1); ++i) {
    if (firstn[i] < secondn[0]) {
      res += firstn[i];
    } else
      break;
  }
  res += secondn[0];
  cout << res << " ";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
