A, B = map(int,input().split(' '))
B += 1
l = "1" if A%4 in [0,1] else "0"
r = "1" if B%4 in [0,1] else "0"
n = 2
while n <= A:
    if A%(2*n)-n <= 0 or A%(2*n)%2 == 0:
        l += "0"
    else:
        l += "1"
    n *= 2
n = 2
while n <= B:
    if B%(2*n)-n <= 0 or B%(2*n)%2 == 0:
        r += "0"
    else:
        r += "1"
    n *= 2
print(int(l[::-1], 2)^int(r[::-1], 2)) A, B = map(int,input().split(' ')) A map(int,input().split(' ')) map int input().split(' ') ().split () input split ' ' B B += 1 B 1 l = "1" if A%4 in [0,1] else "0" l "1" if A%4 in [0,1] else "0" A%4 in [0,1] A%4 A 4 [0,1] 0 1 "1" "0" r = "1" if B%4 in [0,1] else "0" r "1" if B%4 in [0,1] else "0" B%4 in [0,1] B%4 B 4 [0,1] 0 1 "1" "0" n = 2 n 2 while n <= A:
    if A%(2*n)-n <= 0 or A%(2*n)%2 == 0:
        l += "0"
    else:
        l += "1"
    n *= 2 n <= A n A if A%(2*n)-n <= 0 or A%(2*n)%2 == 0:
        l += "0"
    else:
        l += "1"
     A%(2*n)-n <= 0 or A%(2*n)%2 == 0 A%(2*n)-n <= 0 A%(2*n)-n A%(2*n) A 2*n 2 n n 0 A%(2*n)%2 == 0 A%(2*n)%2 A%(2*n) A 2*n 2 n 2 0 l += "0" l "0" l += "1" l "1" n *= 2 n 2 n = 2 n 2 while n <= B:
    if B%(2*n)-n <= 0 or B%(2*n)%2 == 0:
        r += "0"
    else:
        r += "1"
    n *= 2 n <= B n B if B%(2*n)-n <= 0 or B%(2*n)%2 == 0:
        r += "0"
    else:
        r += "1"
     B%(2*n)-n <= 0 or B%(2*n)%2 == 0 B%(2*n)-n <= 0 B%(2*n)-n B%(2*n) B 2*n 2 n n 0 B%(2*n)%2 == 0 B%(2*n)%2 B%(2*n) B 2*n 2 n 2 0 r += "0" r "0" r += "1" r "1" n *= 2 n 2 print(int(l[::-1], 2)^int(r[::-1], 2)) print int(l[::-1], 2)^int(r[::-1], 2) int(l[::-1], 2) int l[::-1] l ::-1 -1 2 int(r[::-1], 2) int r[::-1] r ::-1 -1 2 r += "0" "0" r l = "1" if A%4 in [0,1] else "0" "1" if A%4 in [0,1] else "0" l n = 2 2 n r += "1" "1" r n *= 2 2 n n = 2 2 n B = map(int,input().split(' ')) map(int,input().split(' ')) B B += 1 1 B l += "1" "1" l n *= 2 2 n l += "0" "0" l A, B = map(int,input().split(' ')) map(int,input().split(' ')) A r = "1" if B%4 in [0,1] else "0" "1" if B%4 in [0,1] else "0" r
A, B = map(int,input().split(' '))
B += 1
l = "1" if A%4 in [0,1] else "0"
r = "1" if B%4 in [0,1] else "0"
n = 2
while n <= A:
    if A%(2*n)-n <= 0 or A%(2*n)%2 == 0:
        l += "0"
    else:
        l += "1"
    n *= 2
n = 2
while n <= B:
    if B%(2*n)-n <= 0 or B%(2*n)%2 == 0:
        r += "0"
    else:
        r += "1"
    n *= 2
print(int(l[::-1], 2)^int(r[::-1], 2))