A, B = [int(_) for _ in input().split()]

def g(n):
    ans = 0
    v = (n // 4) * 4
    for x in range(v, n+1):
        ans ^= x
    return ans 

va = g(A-1)
vb = g(B)

print(va ^ vb) int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ A, B = [int(_) for _ in input().split()] A [int(_) for _ in input().split()] B def g(n):
    ans = 0
    v = (n // 4) * 4
    for x in range(v, n+1):
        ans ^= x
    return ans  g ans = 0 ans 0 v = (n // 4) * 4 v (n // 4) * 4 n // 4 n 4 4 for x in range(v, n+1):
        ans ^= x
     x range(v, n+1) range v n+1 n 1 ans ^= x ans x return ans ans n n va = g(A-1) va g(A-1) g A-1 A 1 vb = g(B) vb g(B) g B print(va ^ vb) print va ^ vb va vb B = [int(_) for _ in input().split()] [int(_) for _ in input().split()] B vb = g(B) g(B) vb va = g(A-1) g(A-1) va def g(n):
    ans = 0
    v = (n // 4) * 4
    for x in range(v, n+1):
        ans ^= x
    return ans  def g(n):
    ans = 0
    v = (n // 4) * 4
    for x in range(v, n+1):
        ans ^= x
    return ans  g A, B = [int(_) for _ in input().split()] [int(_) for _ in input().split()] A
A, B = [int(_) for _ in input().split()]

def g(n):
    ans = 0
    v = (n // 4) * 4
    for x in range(v, n+1):
        ans ^= x
    return ans 

va = g(A-1)
vb = g(B)

print(va ^ vb)
