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

bccdb
 z
 dfdeed
 aab
 y
 abac

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx2,tune=native")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("trapv")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using pi = pair<ll, ll>;
const ll mod = 7 * 17 * (1 << 23) + 1;
const ll inf = 1e18 + 69;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset; // order_of_key, find_by_order

int main() { //DINIC ORZ
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
//	oset tt;
//	tt.insert(1);
//	tt.insert(2);
//	cout << *tt.find_by_order(1);return 0;
	string s, t;
	cin >> s >> t;
	sort(all(s));
	sort(rall(t));
	map<char, int> cnts, cntt;
	oset idx;
	for(int i = 0; i < s.size(); i++)
		idx.insert(i);
	for(auto i : s) cnts[i]++;
	for(auto i : t) cntt[i]++;
	int a = 0, b = 0;

	int x;
	string ans(s.size(), '.');
	for(int i = 0; i < s.size(); i++) {
		if(!(i&1)) {
			if(s[a]==t[b]) {
			auto it = idx.find_by_order(cntt[s[a]]);
			if(it==idx.end()) --it;
			x = *it;
			} else x = *idx.begin();
			ans[x]= s[a];
			cnts[s[a++]]--;
		} else {
			if(s[a]==t[b]){
			auto it = idx.find_by_order(cnts[t[b]]);
			if(it==idx.end()) --it;
			x = *it;
			} else x = *idx.begin();
			ans[x] = t[b];
			cntt[t[b++]]--;
		}
		idx.erase(x);
	}
	cout << ans;
}
