#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
long long int a,b;
cin>>a>>b;
long long int tizes=1;
vector<int> megoldas;
while(a/tizes>0.0||b/tizes>0.0)
{
if(a/tizes>0.0&&b/tizes>0.0){
    if((a%(tizes*10))/tizes==(b%(tizes*10))/tizes)
    {
        megoldas.push_back((a%(tizes*10))/tizes);
        megoldas.push_back((a%(tizes*10))/tizes);
    }
    else{//cout<<"assssssssss"<<(a%(tizes*10))/tizes<<endl;
    //cout<<"assssssssss"<<(b%(tizes*10))/tizes<<endl;
        megoldas.push_back(max((a%(tizes*10))/tizes,(b%(tizes*10))/tizes));
        //cout<<max((a%tizes*10)/tizes,(b%tizes*10)/tizes)<<endl;
    }
}
else
{
           megoldas.push_back(max((a%(tizes*10))/tizes,(b%(tizes*10))/tizes));
}
    tizes*=10;
}
for(int i=megoldas.size()-1;i>=0;i--)
{
    cout<<megoldas[i];
}
}