Problem: You are given an integer a that consists of n digits. You are also given a sequence of digits s of length m. The digit in position j (1 ≤ j ≤ m) of sequence s means that you can choose an arbitrary position i (1 ≤ i ≤ n) in a and replace the digit in the chosen position i with sj. Each element in the sequence s can participate in no more than one replacing operation.

Your task is to perform such sequence of replacements, that the given number a gets maximum value. You are allowed to use not all elements from s.

Input

The first line contains positive integer a. Its length n is positive and doesn't exceed 105. The second line contains sequence of digits s. Its length m is positive and doesn't exceed 105. The digits in the sequence s are written consecutively without any separators.

The given number a doesn't contain leading zeroes. 

Output

Print the maximum value that can be obtained from a after a series of replacements. You are allowed to use not all elements from s. The printed number shouldn't contain any leading zeroes.

Examples

Input

1024
010


Output

1124


Input

987
1234567


Output

987

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long inf = std::numeric_limits<long long>::max();
long long mod(long long a) {
  if (a < 0) {
    return -1 * a;
  } else {
    return a;
  }
}
bool isPerfectSquare(long long x) {
  if (x >= 0) {
    long long sr = sqrt(x);
    return (sr * sr == x);
  }
  return false;
}
bool isPrime(long long n) {
  if (n == 0 || n == 1) return false;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int binarySearch(int arr[], int l, int r, int x) {
  while (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
bool findPartiion(int arr[], int n) {
  int sum = 0;
  int i, j;
  for (i = 0; i < n; i++) sum += arr[i];
  if (sum % 2 != 0) return false;
  bool part[sum / 2 + 1];
  for (i = 0; i <= sum / 2; i++) {
    part[i] = 0;
  }
  for (i = 0; i < n; i++) {
    for (j = sum / 2; j >= arr[i]; j--) {
      if (part[j - arr[i]] == 1 || j == arr[i]) part[j] = 1;
    }
  }
  return part[sum / 2];
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long findGCD(long long arr[], long long n) {
  long long result = arr[0];
  for (long long i = 1; i < n; i++) {
    result = gcd(arr[i], result);
    if (result == 1) {
      return 1;
    }
  }
  return result;
}
long long findlcm(int arr[], int n) {
  long long ans = arr[0];
  for (int i = 1; i < n; i++) ans = (((arr[i] * ans)) / (gcd(arr[i], ans)));
  return ans;
}
bool isNumber(string s) {
  for (int i = 0; i < s.length(); i++)
    if (isdigit(s[i]) == false) return false;
  return true;
}
int maxIndex(long long ar[], int n) {
  long long m = *max_element(ar, ar + n);
  for (size_t i = 0; i < n; ++i) {
    if (ar[i] == m) {
      return i;
    }
  }
  return -1;
}
int minIndex(long long ar[], int n) {
  long long m = *min_element(ar, ar + n);
  for (size_t i = 0; i < n; ++i) {
    if (ar[i] == m) {
      return i;
    }
  }
  return -1;
}
int LCSubStr(string X, string Y, int m, int n) {
  int LCSuff[m + 1][n + 1];
  int result = 0;
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j <= n; j++) {
      if (i == 0 || j == 0)
        LCSuff[i][j] = 0;
      else if (X[i - 1] == Y[j - 1]) {
        LCSuff[i][j] = LCSuff[i - 1][j - 1] + 1;
        result = max(result, LCSuff[i][j]);
      } else
        LCSuff[i][j] = 0;
    }
  }
  return result;
}
void solve() {
  string a, b;
  cin >> a >> b;
  sort(b.begin(), b.end(), greater<int>());
  int i = 0, j = 0;
  while (true) {
    if (b[i] > a[j]) {
      a[j] = b[i];
      i++;
      j++;
    } else {
      j++;
    }
    if (i == b.size() || j == a.size()) break;
  }
  cout << a << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}