#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0)

using namespace std;
using namespace __gnu_pbds;

int main()
{

    FAST;

    int x, y; cin >> x >> y;

    int len_x = to_string(x).length();
    int len_y = to_string(y).length();

    int len = max(len_x, len_y);

    long long int num_dec = 1;
    long long int num = 0;

    long long int dec = 10;
    for(int i = 0; i < len; i++){
        int f = (x % dec)/(dec/10);
        int s = (y % dec)/(dec/10);

        if(f == s){
            if(len_x != 0 && len_y != 0){
                num += f * num_dec;
                num_dec *= 10;
                num += f * num_dec;
            }
        }
        else{
            num += max(f, s) * num_dec;
        }

        dec *= 10;
        num_dec *= 10;
        len_x--;
        len_y--;
    }

    cout << num << endl;
    return 0;
}