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.*;

// VK Cup 2012 Round2 Unofficial Div2 Edition
public class Main {
	
	void B(){	// B. Replacing Digits
		Scanner sc = new Scanner(System.in);
		String aa = sc.next();
		String ss = sc.next();
		int al=aa.length(), sl=ss.length();
		int[] a = new int[al];
		for(int i=0; i<al; i++){	a[i] = Integer.parseInt(""+aa.charAt(i));	}
		int[] s = new int[sl];
		for(int i=0; i<sl; i++){	s[i] = Integer.parseInt(""+ss.charAt(i))*-1;	}
		Arrays.sort(s);
		int c=0;
		for(int i=0; i<al; i++){
			if(c < sl){
				if(a[i] < s[c]*-1){
					a[i] = s[c]*-1;
					c++;
				}
			}else{
				break;
			}
		}
		for(int i=0; i<al; i++){	System.out.print(a[i]); }
	}
	
	void D(){	// D. Lemmings
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int h = sc.nextInt();
		Lem[] lems = new Lem[n];
		int[] ww = new int[n];
		for(int i=0; i<n; i++){	ww[i] = sc.nextInt();	}
		int[] vv = new int[n];
		for(int i=0; i<n; i++){	vv[i] = sc.nextInt();	}
		for(int i=0; i<n; i++){	lems[i] = new Lem(i, ww[i], vv[i]);	}
		Arrays.sort(lems);
		
		// debug
		for(int i=0; i<n; i++){	System.out.println("ID:"+lems[i].id+" W:"+lems[i].w+" V:"+lems[i].v); }
		
		// ここで、ガケの割り当て方が問題
		Lem[] lems2 = new Lem[k];
		for(int i=0; i<n; i++){
			lems[i].h = h*(i+1);
		}
		
		Min[] m = new Min[k];
		for(int i=0; i<k; i++){
			m[i] = new Min(lems[i].id, lems[i].h/lems[i].v);
		}
		Arrays.sort(m);
		for(int i=0; i<k; i++){
			System.out.print((m[i].id+1)+" ");
		}
	}
	
	class Min implements Comparable<Min>{
		double min;
		int id;
		Min(int id, double min){
			this.id=id; this.min=min;
		}
		@Override
		public int compareTo(Min o) {
			if(min < o.min)	return -1;
			if(min > o.min)	return 1;
			return 0;
		}
	}
	
	class Lem implements Comparable<Lem>{
		int id,v,w,h;
		Lem(int id, int w, int v){
			this.id=id; this.v=v; this.w=w;
		}
		@Override
		public int compareTo(Lem o) {
			if(w < o.w)	return -1;
			if(w > o.w)	return 1;
			if(v > o.v) return -1;
			if(v < o.v) return 1;
			return 0;
		}
	}
	
	
	void A(){	// A. Chores
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int[] h = new int[n];
		for(int i=0; i<n; i++){
			h[i] = sc.nextInt();
		}
		Arrays.sort(h);
		System.out.println(h[b]-h[b-1]);
	}
	
	public static void main(String[] args) {
		new Main().B();
	}
}