def g(x):
    ret = 1 if x % 4 in {1, 2} else 0
    for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
    return ret


A, B = map(int, input().split())
print(g(A - 1) ^ g(B)) def g(x):
    ret = 1 if x % 4 in {1, 2} else 0
    for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
    return ret g ret = 1 if x % 4 in {1, 2} else 0 ret 1 if x % 4 in {1, 2} else 0 x % 4 in {1, 2} x % 4 x 4 {1, 2} 1 0 for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
     i range(1, 50) range 1 50 if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
     x % (2 << i) >= (1 << i) and not x % 2 x % (2 << i) >= (1 << i) x % (2 << i) x 2 << i 2 i 1 << i 1 i not x % 2 x % 2 x 2 ret += (1 << i) ret 1 << i 1 i return ret ret x x A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B print(g(A - 1) ^ g(B)) print g(A - 1) ^ g(B) g(A - 1) g A - 1 A 1 g(B) g B B = map(int, input().split()) map(int, input().split()) B def g(x):
    ret = 1 if x % 4 in {1, 2} else 0
    for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
    return ret def g(x):
    ret = 1 if x % 4 in {1, 2} else 0
    for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
    return ret g A, B = map(int, input().split()) map(int, input().split()) A
def g(x):
    ret = 1 if x % 4 in {1, 2} else 0
    for i in range(1, 50):
        if x % (2 << i) >= (1 << i) and not x % 2:
            ret += (1 << i)
    return ret


A, B = map(int, input().split())
print(g(A - 1) ^ g(B))
