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