a,b = map(int,input().split())
ans = 0
if b-a <= 4:
    for x in range(a, b+1):
        ans ^= x
else:
    s = a%4
    t = b%4
    if s == 0:
        s = 4
    for x in range(a, a+4-s):
        ans ^= x
    for x in range(b-t, b+1):
        ans ^= x
print(ans) a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b ans = 0 ans 0 if b-a <= 4:
    for x in range(a, b+1):
        ans ^= x
else:
    s = a%4
    t = b%4
    if s == 0:
        s = 4
    for x in range(a, a+4-s):
        ans ^= x
    for x in range(b-t, b+1):
        ans ^= x b-a <= 4 b-a b a 4 for x in range(a, b+1):
        ans ^= x x range(a, b+1) range a b+1 b 1 ans ^= x ans x s = a%4 s a%4 a 4 t = b%4 t b%4 b 4 if s == 0:
        s = 4
     s == 0 s 0 s = 4 s 4 for x in range(a, a+4-s):
        ans ^= x
     x range(a, a+4-s) range a a+4-s a+4 a 4 s ans ^= x ans x for x in range(b-t, b+1):
        ans ^= x x range(b-t, b+1) range b-t b t b+1 b 1 ans ^= x ans x print(ans) print ans t = b%4 b%4 t s = 4 4 s b = map(int,input().split()) map(int,input().split()) b ans ^= x x ans ans = 0 0 ans ans ^= x x ans s = a%4 a%4 s ans ^= x x ans a,b = map(int,input().split()) map(int,input().split()) a
a,b = map(int,input().split())
ans = 0
if b-a <= 4:
    for x in range(a, b+1):
        ans ^= x
else:
    s = a%4
    t = b%4
    if s == 0:
        s = 4
    for x in range(a, a+4-s):
        ans ^= x
    for x in range(b-t, b+1):
        ans ^= x
print(ans)