#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define LPRINT(a, b) for (auto&(a) : (b))
#define li(i,a,b) for (int (i) = (a); (i) < (b); (i)++)
#define lij(i,a,b) for (int (i) = (a); (i) <= (b); (i)++)

int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
int x,y;
cin>>x>>y;
string res = "";
while(x>0 && y>0){
	int l1 = x%10, l2 = y%10;
	x/=10; y/=10;
	if(l1==l2){
		res = to_string(l1) + to_string(l1) + res;
	}
	else{
		res = to_string(max(l1,l2)) + res;
	}
}
if(x!=0||y!=0){
	res = to_string(max(x,y)) + res;
}
cout<<res;


return 0;
}