#include <stdio.h>

int main() {
    int x, y;
    long result = 0, multiplier = 1;
    scanf("%d", &x);
    scanf("%d", &y);

    if(y < x) {
        int temp = x;
        x = y;
        y = temp;
    }

    while (x > 0) {
        short lx = x%10;
        short ly = y%10;

        if(lx > ly)
            result = result * multiplier + lx;
        else if (ly > lx)
            result = result * multiplier + ly;
        else
        {
            result = result * multiplier + lx;
            multiplier *= 10;
            result = result * multiplier + lx;
        }

        multiplier *= 10;
        x /= 10;
        y /= 10;
    }

    while (y > 0) {
        result = result * multiplier + y%10;
        multiplier *= 10;
        y /= 10;
    }

    printf("%ld", result);
}