#include <bits/stdc++.h>
char s1[5000], s2[5000];
int main() {
  scanf("%s%s", s1, s2);
  putchar(*s1);
  for (int i = 1; s1[i] && s1[i] < *s2; ++i) putchar(s1[i]);
  putchar(*s2);
  puts("");
  return 0;
}
