#include <bits/stdc++.h>
char ch1[20], ch2[20];
int n;
int main() {
  scanf("%s%s", ch1, ch2);
  n = strlen(ch1);
  putchar(ch1[0]);
  for (int i = 1; i < n; i++) {
    if (ch1[i] < ch2[0])
      putchar(ch1[i]);
    else
      break;
  }
  putchar(ch2[0]);
  return 0;
}
