a,b = map(int,input().split())
if a==0:
    print(b)
    exit()
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans) a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b if a==0:
    print(b)
    exit() a==0 a 0 print(b) print b exit() exit ab = bin(a-1)[2:] ab bin(a-1)[2:] (a-1) bin a-1 a 1 2: 2 bb = bin(b)[2:] bb bin(b)[2:] (b) bin b 2: 2 sa = [] sa [] sb = [] sb [] if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)] int(bb[-1]) int bb[-1] bb -1 sb = [1] sb [1] 1 for i in bb:
        sb += [int(i)] i bb sb += [int(i)] sb [int(i)] int(i) int i if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)] a>0 a 0 if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)] int(ab[-1]) int ab[-1] ab -1 sa = [1] sa [1] 1 for i in ab:
            # print(2)
            sa += [int(i)] i ab sa += [int(i)] sa [int(i)] int(i) int i sa[-1] = (a//2)%2 sa[-1] sa -1 (a//2)%2 a//2 a 2 2 sb[-1] = ((b+1)//2)%2 sb[-1] sb -1 ((b+1)//2)%2 (b+1)//2 b+1 b 1 2 2 str(i) for i in sa for i in sa i sa for i in sa str(i) str i ta = "".join([str(i) for i in sa]) ta "".join([str(i) for i in sa]) "".join "" join [str(i) for i in sa] str(i) for i in sb for i in sb i sb for i in sb str(i) str i tb = "".join([str(i) for i in sb]) tb "".join([str(i) for i in sb]) "".join "" join [str(i) for i in sb] ta = int(ta,2) ta int(ta,2) int ta 2 tb = int(tb,2) tb int(tb,2) int tb 2 ans = ta^tb ans ta^tb ta tb print(ans) print ans bb = bin(b)[2:] bin(b)[2:] bb sb += [int(i)] [int(i)] sb tb = "".join([str(i) for i in sb]) "".join([str(i) for i in sb]) tb sa += [int(i)] [int(i)] sa ta = int(ta,2) int(ta,2) ta sb = [] [] sb ta = "".join([str(i) for i in sa]) "".join([str(i) for i in sa]) ta sb = [1] [1] sb b = map(int,input().split()) map(int,input().split()) b ans = ta^tb ta^tb ans a,b = map(int,input().split()) map(int,input().split()) a sa = [1] [1] sa tb = int(tb,2) int(tb,2) tb sa = [] [] sa ab = bin(a-1)[2:] bin(a-1)[2:] ab
a,b = map(int,input().split())
if a==0:
    print(b)
    exit()
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans)