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

if __name__ == "__main__":
    main() def main():
    a,b = map(int,input().split())
    def f(n):
        if n%4==0:
            return n
        if n%4==1:
            return 1
        if n%4==2:
            return n + 1
        if n%4==3:
            return 0
    print(f(b)^f(a-1)) main a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def f(n):
        if n%4==0:
            return n
        if n%4==1:
            return 1
        if n%4==2:
            return n + 1
        if n%4==3:
            return 0
     f if n%4==0:
            return n
         n%4==0 n%4 n 4 0 return n n if n%4==1:
            return 1
         n%4==1 n%4 n 4 1 return 1 1 if n%4==2:
            return n + 1
         n%4==2 n%4 n 4 2 return n + 1 n + 1 n 1 if n%4==3:
            return 0
     n%4==3 n%4 n 4 3 return 0 0 n n print(f(b)^f(a-1)) print f(b)^f(a-1) f(b) f b f(a-1) f a-1 a 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    a,b = map(int,input().split())
    def f(n):
        if n%4==0:
            return n
        if n%4==1:
            return 1
        if n%4==2:
            return n + 1
        if n%4==3:
            return 0
    print(f(b)^f(a-1)) def main():
    a,b = map(int,input().split())
    def f(n):
        if n%4==0:
            return n
        if n%4==1:
            return 1
        if n%4==2:
            return n + 1
        if n%4==3:
            return 0
    print(f(b)^f(a-1)) main
def main():
    a,b = map(int,input().split())
    def f(n):
        if n%4==0:
            return n
        if n%4==1:
            return 1
        if n%4==2:
            return n + 1
        if n%4==3:
            return 0
    print(f(b)^f(a-1))

if __name__ == "__main__":
    main()
