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


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


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


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


print(calc(B) ^ calc(A))

