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

int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int x, y, brcif = 1, rez = 0;
    cin >> x >> y;
    
    while(x > 0 || y > 0)
    {
        if((x%10) == (y%10)){
            rez += ((x%10)*10+(x%10))*brcif;
            brcif*=10;
        }
        else if((x%10) > (y%10)) 
            rez += (x%10)*brcif;
        else 
            rez += (y%10)*brcif;
        brcif *= 10; x /= 10; y /= 10;
    }
    cout << rez;
    return 0;
}