a, b = map(int, input().split())

res = 0
if a % 2 == 1:
    res ^= a
    a += 1
if b % 2 == 0:
    res ^= b
    b -= 1
print(res ^ ((b-a+1)//2)%2) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b res = 0 res 0 if a % 2 == 1:
    res ^= a
    a += 1 a % 2 == 1 a % 2 a 2 1 res ^= a res a a += 1 a 1 if b % 2 == 0:
    res ^= b
    b -= 1 b % 2 == 0 b % 2 b 2 0 res ^= b res b b -= 1 b 1 print(res ^ ((b-a+1)//2)%2) print res ^ ((b-a+1)//2)%2 res ((b-a+1)//2)%2 (b-a+1)//2 b-a+1 b-a b a 1 2 2 b = map(int, input().split()) map(int, input().split()) b res ^= b b res res ^= a a res res = 0 0 res a += 1 1 a a, b = map(int, input().split()) map(int, input().split()) a b -= 1 1 b
a, b = map(int, input().split())

res = 0
if a % 2 == 1:
    res ^= a
    a += 1
if b % 2 == 0:
    res ^= b
    b -= 1
print(res ^ ((b-a+1)//2)%2)
