#include <bits/stdc++.h>
using namespace std;
const int N = 20;
char s1[N], s2[N], ans[N];
int main() {
  scanf("%s%s", s1, s2);
  int n1 = strlen(s1), cnt = 0;
  ans[cnt++] = s1[0];
  for (int i = 1; i < n1; i++) {
    if (s1[i] >= s2[0]) break;
    ans[cnt++] = s1[i];
  }
  ans[cnt++] = s2[0];
  printf("%s\n", ans);
  return 0;
}
