import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public void run(){
        byte[] a, b;
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        a = (in.nextLine() + 'A').getBytes();
        b = (in.nextLine() + 'A').getBytes();

        int fullLength = a.length + b.length - 2, ai = 0, bi = 0;

        for(int i = 0; i < fullLength; i++){
            if(a[ai] > b[bi]) {
                out.print((char) b[bi]);
                bi++;
            }
            else if(a[ai] < b[bi]) {
                out.print((char) a[ai]);
                ai++;
            }
            else {
                if(a[ai + 1] > b[bi + 1]) {
                    out.print((char) b[bi]);
                    bi++;
                }
                else if(a[ai + 1] < b[bi + 1]) {
                    out.print((char) a[ai]);
                    ai++;
                }
                else {
                    if(a[a.length - 2] >= b[b.length - 2]) {
                        out.print((char) b[bi]);
                        bi++;
                    }
                    else {
                        out.print((char) a[ai]);
                        ai++;
                    }
                }
            }
        }

        out.flush();
        out.close();
    }

    public static void main(String[] args) {
        new Main().run();
    }
}