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 JAVA):

Solution:

import java.util.*;
public class ReplacingDigits {

    public static void main (String[] args){
        Scanner k = new Scanner(System.in);
        String n = k.nextLine();
        StringBuilder num = new StringBuilder(n);
        String change = k.nextLine();
//      int i = diff(num);
        int len = change.length();
//      if(change.contains("0"))change=c(change);
//      change=sort(change);
//      if(num.length() > 6 && num.charAt(0) != '9')System.out.println(change);
//      System.out.println(change);
//      if(change.length()>50)System.out.println(change);
//      char c = change.charAt(0);
        char[] cha = change.toCharArray();
        Arrays.sort(cha);
        int i = cha.length-1;
        int j=0;
        char p = cha[i];
    
//          for(int j =cha.length-1;i>=1;i--){
        while(j<=num.length()-1 && i>=0){
            if(num.charAt(j)<cha[i]){
                num.setCharAt(j,cha[i]);
                i--;
            }
            j++;
//          else 
        }
        
        System.out.println(num);
    }

    public static String replaceChar(String n,char c){
        //              System.out.println(n + " hi");
        int i = 0;
        //              System.out.println(n);
        boolean less = false;
        while(i<n.length()-1 && !less){
            if(n.charAt(i)<c)less=true;
            //                  System.out.println("I: "+i+  " char: "+ n.charAt(i) + " c: "  + c);}
            else i++;
        }
        //              System.out.println(i);
        //              System.out.println(n.substring(0,i));
        if(i<n.length()-1)return n.substring(0,i)+c+n.substring(i+1);
        else if(i == n.length()-1 && n.charAt(i)<c)return n.substring(0,i)+c;
        return n;

    }

    public static int diff(String n){
        char c = n.charAt(0);
        //      System.out.println(c);
        for(int i=0;i<n.length();i++){
            //          System.out.println(n.charAt(i));
            if(n.charAt(i) != c)return i-1;
        }
        return n.length()-1;
    }

    public static String c (String change){
        String c = "";
        char [] cha=change.toCharArray();
        for(char ch:cha){
//          if(change.charAt(i) != '0')c+=change.charAt(i);
            if(ch != '0')c+=ch;
        }
        return c;
    }

    public static long value(String s){
        long v = 0;
        for(int i= 0;i<s.length();i++)v+=Integer.parseInt(s.substring(i,i+1));
        return v;
    }
    
    public static String sort(String c){
        String s = "";
        int [] a = new int[c.length()];
        for(int i=0;i<a.length;i++)a[i]=Integer.parseInt(c.substring(i,i+1));
        Arrays.sort(a);
        for(int i=a.length-1;i>=0;i--)s+=""+a[i];
        return s;
    }
}