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.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;

public class SolB {

	private static InputReader in;
	private static PrintWriter out;

	public static void main(String[] args) throws IOException {
		in = new InputReader(System.in);
		out = new PrintWriter(System.out);

		run();
		out.close();
	}

	public static void run() {
		String a = in.readString();
		int n = a.length();
		int[] arr = new int[a.length()];
		for(int i = 0; i < n; i++) {
			arr[i] =a.charAt(i) - '0';
		}
		String s = in.readString();
		int m = s.length();
		int[] brr = new int[m];
		int[] kol = new int[10];
		for(int i = 0; i < m; i++) {
			kol[s.charAt(i) - '0']++;
		}
//		Arrays.sort(arr, new Comparator<Pair>() {
//
//			@Override
//			public int compare(Pair o1, Pair o2) {
//				if (o1.v != o2.v) {
//				return o2.v - o1.v;
//				} else {
//					return o1.ind - o2.ind;
//				}
//			}
//			
//		});
		
		
//		Arrays.sort(arr, new Comparator<Pair>() {
//
//			@Override
//			public int compare(Pair o1, Pair o2) {
//				return o1.ind - o2.ind;
//			}
//		});
		for(int i = 0; i < n; i++) {
			for(int j = 9; j >= 0; j--) {
				if (kol[j] > 0 && j > arr[i]) {
					arr[i] = j;
					kol[j]--;
					break;
				}
			}
		}
		
		for(int i = 0; i < n; i++) {
			out.print(arr[i]);
		}
	}
}

class Pair {
	int v;
	int ind;
	public Pair(int v, int ind) {
		super();
		this.v = v;
		this.ind = ind;
	}
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuffer res = new StringBuffer();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public String next() {
		return readString();
	}
}