A, B = map(int, input().split())

def xor(n):
    if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0



print(xor(A-1)^xor(B)) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B def xor(n):
    if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 xor if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 n%4==0 n%4 n 4 0 return 1^(n+1) 1^(n+1) 1 n+1 n 1 elif n%4==1:
        return 1
     n%4==1 n%4 n 4 1 return 1 1 elif n%4==2:
        return n+1
     n%4==2 n%4 n 4 2 return n+1 n+1 n 1 return 0 0 n n print(xor(A-1)^xor(B)) print xor(A-1)^xor(B) xor(A-1) xor A-1 A 1 xor(B) xor B A, B = map(int, input().split()) map(int, input().split()) A B = map(int, input().split()) map(int, input().split()) B def xor(n):
    if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 def xor(n):
    if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0 xor
A, B = map(int, input().split())

def xor(n):
    if n%4==0:
        return 1^(n+1)
    elif n%4==1:
        return 1
    elif n%4==2:
        return n+1
    else:
        return 0



print(xor(A-1)^xor(B))