#include <stdio.h>
#include <stdlib.h>
long long zad1(int a, int b) {
    int cifre[50];
    int br_cif = 0;

    while(a > 0 && b > 0) {
        int ca = a % 10;
        int cb = b % 10;

        if (ca > cb) {
            cifre[br_cif++] = ca;
        } else if (ca < cb) {
            cifre[br_cif++] = cb;
        } else {
            cifre[br_cif++] = ca;
            cifre[br_cif++] = cb;
        }

        a /= 10;
        b /= 10;
    }
    if (a != 0 || b != 0) {
        int tmp;
        if (a != 0) tmp = a;
        else tmp = b;

        while(tmp > 0) {
            cifre[br_cif++] = tmp % 10;
            tmp /= 10;
        }
    }

    long long resenje = 0;
    for (int i = br_cif-1; i >= 0; i--) {
        int tren_cif = cifre[i];
        resenje = resenje * 10 + tren_cif;
    }

    return resenje;
}
int main()
{
    int X, Y;
    scanf("%d", &X);
    scanf("%d", &Y);
    int c = zad1(X, Y);
    printf("%lld\n", c);
    return 0;
}