#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
map<long long, int> mp;
char ss[1000060];
int f[110][110];
int n, m, r;
int main() {
  string s1, s2;
  while (cin >> s1) {
    cin >> s2;
    cout << s1[0];
    for (int i = 1; i <= s1.length() - 1; i++) {
      if (s1[i] < s2[0])
        cout << s1[i];
      else
        break;
    }
    cout << s2[0] << endl;
  }
}
