#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int x,y;
    cin >> x >> y;
    
    string z = "";
    while(x>0||y>0)
    {
        int x_ = x%10; int y_ = y%10;
        
        if(x<10) x_ = x;
        if(y<10) y_ = y;
        
        x/=10; y/=10;
        if(x_==y_ && x_!=0)
        {
            z+=x_+'0';
            z+=y_+'0';
        }
        else if(x_>y_)
            z+=x_+'0';
        else
            z+=y_+'0';
            
    }
    reverse(z.begin(), z.end());
    cout << z << "\n";
    
    return 0;
}