from functools import reduce
a,b = map(int,input().split())
a -= 1
print(reduce(lambda x,y:x^y,list(range(a-a%4,a+1))+list(range(b-b%4,b+1)))) from functools import reduce a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b a -= 1 a 1 print(reduce(lambda x,y:x^y,list(range(a-a%4,a+1))+list(range(b-b%4,b+1)))) print reduce(lambda x,y:x^y,list(range(a-a%4,a+1))+list(range(b-b%4,b+1))) reduce lambda x,y:x^y x^y x y x y list(range(a-a%4,a+1))+list(range(b-b%4,b+1)) list(range(a-a%4,a+1)) list range(a-a%4,a+1) range a-a%4 a a%4 a 4 a+1 a 1 list(range(b-b%4,b+1)) list range(b-b%4,b+1) range b-b%4 b b%4 b 4 b+1 b 1 a -= 1 1 a b = map(int,input().split()) map(int,input().split()) b a,b = map(int,input().split()) map(int,input().split()) a
from functools import reduce
a,b = map(int,input().split())
a -= 1
print(reduce(lambda x,y:x^y,list(range(a-a%4,a+1))+list(range(b-b%4,b+1))))