a,b=map(int,input().split())

def culc(x):
    if x%4==0:
        return x
    elif x%4==1:
        return 1
    elif x%4==2:
        return x+1
    else:
        return 0


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

def culc(x):
    if x%4==0:
        return x
    elif x%4==1:
        return 1
    elif x%4==2:
        return x+1
    else:
        return 0


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