bcdef
abbbc
 z
y
 reddit
abcdef
 abc
aaa
 y
z
 cbxz
aaaa

bccdb
 z
 dfdeed
 aab
 y
 abac

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            CNamingCompany solver = new CNamingCompany();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class CNamingCompany {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            char[] s = new char[(int) 3e5];
            char[] t = new char[(int) 3e5];
            int n = in.readString(s, 0);
            in.readString(t, 0);

            Counter a = new Counter(s, n);
            Counter b = new Counter(t, n);

            int[] ans = new int[n];
            dfs(a, b, ans, 0, n - 1);
            for (int i = 0; i < n; i++) {
                ans[i] = Math.abs(ans[i]);
            }
            for (int i = 0; i < n; i++) {
                out.append((char) ans[i]);
            }
        }

        public void dfs(ICounter a, ICounter b, int[] ans, int l, int r) {
            if (l > r) {
                return;
            }
            if (a.min() < b.max()) {
                ans[l++] = a.min();
                a.popMin();
            } else {
                ans[r--] = a.max();
                a.popMax();
            }
            dfs(b.inverse(), a.inverse(), ans, l, r);
        }

    }

    static class Counter implements ICounter {
        int[] cnts = new int[128];
        int l = 0;
        int r = cnts.length - 1;
        InvCounter inv = new InvCounter(this);

        public Counter(char[] s, int n) {
            for (int i = 0; i < n; i++) {
                cnts[s[i]]++;
            }
        }

        private void handleLeft() {
            while (l <= r && cnts[l] == 0) {
                l++;
            }
        }

        private void handleRight() {
            while (l <= r && cnts[r] == 0) {
                r--;
            }
        }

        public int max() {
            handleRight();
            return r;
        }

        public int min() {
            handleLeft();
            return l;
        }

        public void popMin() {
            cnts[l]--;
        }

        public void popMax() {
            cnts[r]--;
            while (l <= r && cnts[r] == 0) {
                r--;
            }
        }

        public ICounter inverse() {
            return inv;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class InvCounter implements ICounter {
        ICounter inner;

        public InvCounter(ICounter inner) {
            this.inner = inner;
        }

        public int max() {
            return -inner.min();
        }

        public void popMax() {
            inner.popMin();
        }

        public int min() {
            return -inner.max();
        }

        public void popMin() {
            inner.popMax();
        }

        public ICounter inverse() {
            return inner;
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readString(char[] data, int offset) {
            skipBlank();

            int originalOffset = offset;
            while (next > 32) {
                data[offset++] = (char) next;
                next = read();
            }

            return offset - originalOffset;
        }

    }

    static interface ICounter {
        int max();

        void popMax();

        int min();

        void popMin();

        ICounter inverse();

    }
}

