a,b = map(int,input().split())
am = a%4
bm = b%4
ad = a//4
bd = b//4
ans = 0
if ad == bd:
    for i in range(a, b+1):
        ans ^= i
else:
    while am != 0:
        ans ^= a
        a += 1
        am += 1
        am %= 4
    while bm != 3:
        ans ^= b
        b -= 1
        bm -= 1
        bm %= 4
print(ans)
 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b am = a%4 am a%4 a 4 bm = b%4 bm b%4 b 4 ad = a//4 ad a//4 a 4 bd = b//4 bd b//4 b 4 ans = 0 ans 0 if ad == bd:
    for i in range(a, b+1):
        ans ^= i
else:
    while am != 0:
        ans ^= a
        a += 1
        am += 1
        am %= 4
    while bm != 3:
        ans ^= b
        b -= 1
        bm -= 1
        bm %= 4 ad == bd ad bd for i in range(a, b+1):
        ans ^= i i range(a, b+1) range a b+1 b 1 ans ^= i ans i while am != 0:
        ans ^= a
        a += 1
        am += 1
        am %= 4
     am != 0 am 0 ans ^= a ans a a += 1 a 1 am += 1 am 1 am %= 4 am 4 while bm != 3:
        ans ^= b
        b -= 1
        bm -= 1
        bm %= 4 bm != 3 bm 3 ans ^= b ans b b -= 1 b 1 bm -= 1 bm 1 bm %= 4 bm 4 print(ans) print ans bm = b%4 b%4 bm a += 1 1 a ans ^= b b ans am %= 4 4 am ad = a//4 a//4 ad ans ^= a a ans bd = b//4 b//4 bd am = a%4 a%4 am b -= 1 1 b am += 1 1 am bm %= 4 4 bm b = map(int,input().split()) map(int,input().split()) b bm -= 1 1 bm ans = 0 0 ans ans ^= i i ans a,b = map(int,input().split()) map(int,input().split()) a
a,b = map(int,input().split())
am = a%4
bm = b%4
ad = a//4
bd = b//4
ans = 0
if ad == bd:
    for i in range(a, b+1):
        ans ^= i
else:
    while am != 0:
        ans ^= a
        a += 1
        am += 1
        am %= 4
    while bm != 3:
        ans ^= b
        b -= 1
        bm -= 1
        bm %= 4
print(ans)

