def main():
    A,B = map(int,input().split())
    if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A

print(main()) def main():
    A,B = map(int,input().split())
    if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A main A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A A == B A B return A A elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
     A%2 == 0 and B%2 == 0 A%2 == 0 A%2 A 2 0 B%2 == 0 B%2 B 2 0 tmp = int((B-A)/2) tmp int((B-A)/2) int (B-A)/2 B-A B A 2 if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
     tmp%2 == 0 tmp%2 tmp 2 0 return 0^B 0^B 0 B return 1^B 1^B 1 B elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
     A%2 == 0 and B%2 == 1 A%2 == 0 A%2 A 2 0 B%2 == 1 B%2 B 2 1 tmp = int((B-A+1)/2) tmp int((B-A+1)/2) int (B-A+1)/2 B-A+1 B-A B A 1 2 if tmp%2 == 0:
            return 0
        else:
            return 1
     tmp%2 == 0 tmp%2 tmp 2 0 return 0 0 return 1 1 elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
     A%2 == 1 and B%2 == 0 A%2 == 1 A%2 A 2 1 B%2 == 0 B%2 B 2 0 tmp = int((B-A-1)/2) tmp int((B-A-1)/2) int (B-A-1)/2 B-A-1 B-A B A 1 2 if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
     tmp%2 == 0 tmp%2 tmp 2 0 return 0^B^A 0^B^A 0^B 0 B A return 1^B^A 1^B^A 1^B 1 B A elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A A%2 == 1 and B%2 == 1 A%2 == 1 A%2 A 2 1 B%2 == 1 B%2 B 2 1 tmp = int((B-A)/2) tmp int((B-A)/2) int (B-A)/2 B-A B A 2 if tmp%2 == 0:
            return 0^A
        else:
            return 1^A tmp%2 == 0 tmp%2 tmp 2 0 return 0^A 0^A 0 A return 1^A 1^A 1 A print(main()) print main() main def main():
    A,B = map(int,input().split())
    if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A def main():
    A,B = map(int,input().split())
    if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A main
def main():
    A,B = map(int,input().split())
    if A == B:
        return A
    elif A%2 == 0 and B%2 == 0:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^B
        else:
            return 1^B
    elif A%2 == 0 and B%2 == 1:
        tmp = int((B-A+1)/2)
        if tmp%2 == 0:
            return 0
        else:
            return 1
    elif A%2 == 1 and B%2 == 0:
        tmp = int((B-A-1)/2)
        if tmp%2 == 0:
            return 0^B^A
        else:
            return 1^B^A
    elif A%2 == 1 and B%2 == 1:
        tmp = int((B-A)/2)
        if tmp%2 == 0:
            return 0^A
        else:
            return 1^A

print(main())
