def main():
    a, b = map(int, input().split())

    # f(A, B) = f(0, a-1) ^ f(0, b) = F(a-1) ^ F(b)
    def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

    print(F(a-1) ^ F(b))

main() def main():
    a, b = map(int, input().split())

    # f(A, B) = f(0, a-1) ^ f(0, b) = F(a-1) ^ F(b)
    def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

    print(F(a-1) ^ F(b)) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

     F if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

     x % 2 == 0 x % 2 x 2 0 if x % 4 == 0:
                return x
            else:
                return x ^ 1
         x % 4 == 0 x % 4 x 4 0 return x x return x ^ 1 x ^ 1 x 1 if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

     (x + 1) % 4 == 0 (x + 1) % 4 x + 1 x 1 4 0 return 0 0 return 1 1 x x print(F(a-1) ^ F(b)) print F(a-1) ^ F(b) F(a-1) F a-1 a 1 F(b) F b main() main def main():
    a, b = map(int, input().split())

    # f(A, B) = f(0, a-1) ^ f(0, b) = F(a-1) ^ F(b)
    def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

    print(F(a-1) ^ F(b)) def main():
    a, b = map(int, input().split())

    # f(A, B) = f(0, a-1) ^ f(0, b) = F(a-1) ^ F(b)
    def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

    print(F(a-1) ^ F(b)) main
def main():
    a, b = map(int, input().split())

    # f(A, B) = f(0, a-1) ^ f(0, b) = F(a-1) ^ F(b)
    def F(x):
        if x % 2 == 0:
            if x % 4 == 0:
                return x
            else:
                return x ^ 1
        else:
            if (x + 1) % 4 == 0:
                return 0
            else:
                return 1

    print(F(a-1) ^ F(b))

main()