def main():
	A, B = [int(n) for n in input().split(" ")]
	d = B - A
	if d == 0:
		print(A)
		return 0
	if d == 1:
		print(A ^ B)
		return 0
	begin = A + A % 2
	end = B + B % 2 - 1
	pair = int((end - begin + 1) / 2)
	print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2)))

main() def main():
	A, B = [int(n) for n in input().split(" ")]
	d = B - A
	if d == 0:
		print(A)
		return 0
	if d == 1:
		print(A ^ B)
		return 0
	begin = A + A % 2
	end = B + B % 2 - 1
	pair = int((end - begin + 1) / 2)
	print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2))) main int(n) for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") int(n) int n A, B = [int(n) for n in input().split(" ")] A [int(n) for n in input().split(" ")] B d = B - A d B - A B A if d == 0:
		print(A)
		return 0
	 d == 0 d 0 print(A) print A return 0 0 if d == 1:
		print(A ^ B)
		return 0
	 d == 1 d 1 print(A ^ B) print A ^ B A B return 0 0 begin = A + A % 2 begin A + A % 2 A A % 2 A 2 end = B + B % 2 - 1 end B + B % 2 - 1 B + B % 2 B B % 2 B 2 1 pair = int((end - begin + 1) / 2) pair int((end - begin + 1) / 2) int (end - begin + 1) / 2 end - begin + 1 end - begin end begin 1 2 print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2))) print (A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2)) (A * (A % 2)) ^ pair % 2 A * (A % 2) A A % 2 A 2 pair % 2 pair 2 B * (1 - B % 2) B 1 - B % 2 1 B % 2 B 2 main() main def main():
	A, B = [int(n) for n in input().split(" ")]
	d = B - A
	if d == 0:
		print(A)
		return 0
	if d == 1:
		print(A ^ B)
		return 0
	begin = A + A % 2
	end = B + B % 2 - 1
	pair = int((end - begin + 1) / 2)
	print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2))) def main():
	A, B = [int(n) for n in input().split(" ")]
	d = B - A
	if d == 0:
		print(A)
		return 0
	if d == 1:
		print(A ^ B)
		return 0
	begin = A + A % 2
	end = B + B % 2 - 1
	pair = int((end - begin + 1) / 2)
	print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2))) main
def main():
	A, B = [int(n) for n in input().split(" ")]
	d = B - A
	if d == 0:
		print(A)
		return 0
	if d == 1:
		print(A ^ B)
		return 0
	begin = A + A % 2
	end = B + B % 2 - 1
	pair = int((end - begin + 1) / 2)
	print((A * (A % 2)) ^ pair % 2 ^ (B * (1 - B % 2)))

main()