The preferred way to generate user login in Polygon is to concatenate a prefix of the user's first name and a prefix of their last name, in that order. Each prefix must be non-empty, and any of the prefixes can be the full name. Typically there are multiple possible logins for each person.

You are given the first and the last name of a user. Return the alphabetically earliest login they can get (regardless of other potential Polygon users).

As a reminder, a prefix of a string s is its substring which occurs at the beginning of s: "a", "ab", "abc" etc. are prefixes of string "{abcdef}" but "b" and 'bc" are not. A string a is alphabetically earlier than a string b, if a is a prefix of b, or a and b coincide up to some position, and then a has a letter that is alphabetically earlier than the corresponding letter in b: "a" and "ab" are alphabetically earlier than "ac" but "b" and "ba" are alphabetically later than "ac".

Input

The input consists of a single line containing two space-separated strings: the first and the last names. Each character of each string is a lowercase English letter. The length of each string is between 1 and 10, inclusive. 

Output

Output a single string — alphabetically earliest possible login formed from these names. The output should be given in lowercase as well.

Examples

Input

harry potter


Output

hap


Input

tom riddle


Output

tomr
#include <bits/stdc++.h>
using namespace std;
vector<int> isPrime(1e5 + 1, true);
void findPrime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (int j = i * i; j <= n; j += i) isPrime[j] = false;
    }
  }
  return;
}
void printV(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  return;
}
void inputV(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) {
    cin >> v[i];
  }
}
bool isPrimeINT(int n) {
  if (n <= 1) return false;
  if (n == 2) {
    return true;
  }
  for (int i = 3; i < n / 2 + 1; i = i + 2)
    if (n % i == 0) return false;
  return true;
}
int interact(int i, int j) {
  cout << "? " << i + 1 << " " << j + 1 << "\n";
  int x;
  cin >> x;
  return x;
}
vector<int> factors(int n) {
  vector<int> v;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i != n / i) v.push_back(n / i);
    }
  }
  return v;
}
vector<long long> fact(1e6, 1);
void factorial(long long n) {
  for (long long i = 1; i <= n; i++) {
    fact[i] =
        (fact[i - 1] % (long long)1000000007 * i % (long long)1000000007) %
        (long long)1000000007;
  }
}
bool checkP(long long r1, long long c1, long long r2, long long c2) {
  return ((r1 + c1) == (r2 + c2) || (r1 - c1) == (r2 - c2) ||
          (abs(r1 - r2) + abs(c1 - c2) <= 3));
}
void test_case() {
  long long n, m, k = 0, i, j, res = 0;
  string S, ans = "", s1, s2;
  cin >> s1 >> s2;
  i = 1, j = 0;
  ans.push_back(s1[0]);
  while (i < s1.size()) {
    if (s1[i] < s2[j]) {
      ans.push_back(s1[i]);
      i++;
    } else {
      ans.push_back(s2[j]);
      cout << ans;
      return;
    }
  }
  ans.push_back(s2[j]);
  cout << ans;
  return;
}
int main() {
  long long TT = 1;
  for (long long i = 0; i < TT; i++) {
    test_case();
  }
  return 0;
}
