a,b = map(int,input().split())
l = []
if a % 4 != 0:
    for i in range(a-1,-6,-1):
        l.append(i)
        if i % 4 == 0:
            break
if b % 4 != 3:
    for i in range(b+1,10**12+5):
        l.append(i)
        if i % 4 == 3:
            break
# print(l)
ans = 0
for i in l:
    ans = ans ^ i
print(ans) a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b l = [] l [] if a % 4 != 0:
    for i in range(a-1,-6,-1):
        l.append(i)
        if i % 4 == 0:
            break a % 4 != 0 a % 4 a 4 0 for i in range(a-1,-6,-1):
        l.append(i)
        if i % 4 == 0:
            break i range(a-1,-6,-1) range a-1 a 1 -6 -1 l.append(i) l.append l append i if i % 4 == 0:
            break i % 4 == 0 i % 4 i 4 0 break if b % 4 != 3:
    for i in range(b+1,10**12+5):
        l.append(i)
        if i % 4 == 3:
            break
# print(l) b % 4 != 3 b % 4 b 4 3 for i in range(b+1,10**12+5):
        l.append(i)
        if i % 4 == 3:
            break
# print(l) i range(b+1,10**12+5) range b+1 b 1 10**12+5 10**12 10 12 5 l.append(i) l.append l append i if i % 4 == 3:
            break
# print(l) i % 4 == 3 i % 4 i 4 3 break ans = 0 ans 0 for i in l:
    ans = ans ^ i i l ans = ans ^ i ans ans ^ i ans i print(ans) print ans ans = ans ^ i ans ^ i ans ans = 0 0 ans l = [] [] l b = map(int,input().split()) map(int,input().split()) b a,b = map(int,input().split()) map(int,input().split()) a
a,b = map(int,input().split())
l = []
if a % 4 != 0:
    for i in range(a-1,-6,-1):
        l.append(i)
        if i % 4 == 0:
            break
if b % 4 != 3:
    for i in range(b+1,10**12+5):
        l.append(i)
        if i % 4 == 3:
            break
# print(l)
ans = 0
for i in l:
    ans = ans ^ i
print(ans)