def prefix_XOR(n):
	if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1)
A, B = map(int,input().split())
print(prefix_XOR(B)^prefix_XOR(A-1)) def prefix_XOR(n):
	if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1) prefix_XOR if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1) n&1 n 1 if n&2:
			return 0
		else:
			return 1
	 n&2 n 2 return 0 0 return 1 1 return (n+1)^prefix_XOR(n+1) (n+1)^prefix_XOR(n+1) n+1 n 1 prefix_XOR(n+1) prefix_XOR n+1 n 1 n n A, B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B print(prefix_XOR(B)^prefix_XOR(A-1)) print prefix_XOR(B)^prefix_XOR(A-1) prefix_XOR(B) prefix_XOR B prefix_XOR(A-1) prefix_XOR A-1 A 1 A, B = map(int,input().split()) map(int,input().split()) A B = map(int,input().split()) map(int,input().split()) B def prefix_XOR(n):
	if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1) def prefix_XOR(n):
	if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1) prefix_XOR
def prefix_XOR(n):
	if n&1:
		if n&2:
			return 0
		else:
			return 1
	else:
		return (n+1)^prefix_XOR(n+1)
A, B = map(int,input().split())
print(prefix_XOR(B)^prefix_XOR(A-1))