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.*;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
		public final class Solution {
		static PrintWriter out = new PrintWriter(System.out); 
		static void flush() {
	 	out.flush();
	 	}
		static int gcd(int a, int b) { 
			if (b == 0) return a; 
			return gcd(b, a % b);  
			}
		static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;
	
	    public FastReader() {
	    br = new BufferedReader(new
	    InputStreamReader(System.in));
	    }
	    static boolean isPalindrome(String str1, String str2) {
	    String str3 = str1+str2;
	    int i = 0, j = str3.length()-1;
	    while(i < j) {
	    char a = str3.charAt(i), b = str3.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    static boolean isPalindrome(String str) {
	    int i = 0, j = str.length()-1;
	    while(i < j) {
	    char a = str.charAt(i), b = str.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    String next() {
	    while (st == null || !st.hasMoreElements()) {
	    try{st = new StringTokenizer(br.readLine());}
	    catch (IOException  e) {e.printStackTrace();}
	    }
	    return st.nextToken();
	    }
	    int nextInt(){ return Integer.parseInt(next()); }
	    long nextLong() { return Long.parseLong(next());}
	    static int fact(int n) {
	    if(n == 1) return 1;
	    return n * fact(n-1);
	   	}
	    public int[] readIntArray(int n) {
	    int[] arr = new int[n];
		for(int i=0; i<n; ++i)
		arr[i]=nextInt();
		return arr;
		}
	    public int[][] readIntArray(int m, int n){
		int[][] arr = new int[m][n];
		for(int i = 0;i<m;i++) 
		for(int j = 0;j<n;j++) 
		arr[i][j] = nextInt();
		return arr;
	    }
	    public String[] readStringArray(int n) {
		String[] arr = new String[n];
		for(int i=0; i<n; ++i)
		arr[i]= nextLine();
		return arr;
	    }
		
	    double nextDouble() {return Double.parseDouble(next());}
	    String nextLine() {
	    String str = "";
	    try{str = br.readLine();}
	    catch (IOException e) {e.printStackTrace();}
	    return str;}
	    }
		
		static void solve(char[] a, char[] s) {
			
			int na = a.length,nb =  s.length;
			
			int[] p = new int[nb];
			for(int i = 0;i<nb;i++) {
				p[i] = Character.getNumericValue(s[i]);
			}
			Arrays.parallelSort(p);
			
			int j = p.length-1; char y = 0;
			for(int i = 0;i<na;i++) {
				int fl = 0;
					if(j < 0) {
					out.print(a[i]);
					continue;
					}
					else if(p[j] > Character.getNumericValue(a[i])) {
						fl = 1;
					}
					if(fl == 1) {
						out.print(p[j]);
						j--;
					}
					else {
						out.print(a[i]);
					}
			}
		}
		public static void main(String args[]) throws Exception {
	    FastReader sc = new FastReader();
	    long start = System.currentTimeMillis();
	    char[] a = sc.next().toCharArray();
	    char[] s = sc.next().toCharArray();
	    solve(a,s);
	    flush();
	    long end = System.currentTimeMillis();
	    NumberFormat formatter = new DecimalFormat("#0.00000");
	    //System.out.print("Execution time is " + formatter.format((end - start) / 1000d) + " seconds");
	    }
	}