#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a,b,c,d,e,f,counter,counter1;
    counter = 0;
    counter1 = 0;
    cin>>a;
    c=a;
    cin>>b;
    d=b;
    vector<int> konacanbroj;

    while(c!=0){
        counter =counter +1;
        c /= 10;
    }
    while(d!=0){
        counter1 =counter1 +1;
        d /= 10;
    }
    for (int i =0;i <max(counter,counter1);i++){
        int l = a%10;
        int k = b%10;



        if(i > min(counter1,counter)){
            konacanbroj.push_back(max(l,k));
        }
        else if(i < min(counter1,counter) && l == k){
            konacanbroj.push_back(max(l,k));
            konacanbroj.push_back(max(l,k));

        }
        else {
            konacanbroj.push_back(max(l,k));
        }
        a/=10;
        b/=10;

    }

    for(int i =1; i<= konacanbroj.size();i++){
       cout<<konacanbroj.at(konacanbroj.size()-i);
    }

}