#include <bits/stdc++.h>
using namespace std;
bool isprime(unsigned long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (unsigned long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int exp(long long int value, long long int power) {
  long long int result = 1;
  while (power > 0) {
    if (power & 1LL) {
      result *= value;
      result %= 1000000007;
    }
    value *= value;
    value %= 1000000007;
    power /= 2LL;
  }
  return result;
}
long long int lcm(long long n1, long long n2) {
  long long max = (n1 > n2) ? n1 : n2;
  do {
    if (max % n1 == 0 && max % n2 == 0) {
      return max;
    } else
      ++max;
  } while (true);
}
int isprime(long long n) {
  if (n == 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6) {
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  }
  return 1;
}
long long a[1000005];
long long b[1000005];
long long c[1000005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int d, min_, max_, ans, n, sum, f, j, cnt, len, row, col, p, q, r,
      t, i, k, l, m, x, y, z;
  string s, s1, s2;
  long long l1, l2;
  cin >> s1 >> s2;
  l1 = s1.size();
  l2 = s2.size();
  s = s1[0];
  for (i = 1; i < l1; i++) {
    if (s1[i] < s2[0])
      s += s1[i];
    else
      break;
  }
  s += s2[0];
  cout << s;
  return 0;
}
