import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader brr = new BufferedReader(new InputStreamReader(System.in));
        int x = Integer.parseInt(brr.readLine());
        int y = Integer.parseInt(brr.readLine());

        int novibr = 0;
        int br = 1;

        while (x != 0 && y != 0){
            if(x % 10 > y % 10){
                novibr += (br * (x%10));
                br *= 10;

            } else if (x % 10 < y % 10) {
                novibr += (br * (y%10));
                br *= 10;
            }else{
                int a = (x%10) * 11;
                novibr +=  (a * br );
                br *= 100;
            }

            x /= 10;
            y /= 10;
        }


        while (x != 0){
            if(x % 10 == 0){
                br *= 10;
            }
            novibr += ((x%10) * br);
            x /= 10;
        }
        while (y != 0){
            if(y % 10 == 0){
                br *= 10;
            }
            novibr += ((y%10) * br);
            y /= 10;
        }

        System.out.println(novibr);
    }
}