a, b = map(int, input().split())
rec = 0
len = b - a + 1
if a % 2 == 0:
    if len % 2 == 1:
        if (len - 1) % 4 == 0:
            rec = b
        else:
            rec = 1^b
    else:
        if len % 4 == 0:
            rec = 0
        else:
            rec = 1
else:
    if len % 2 == 0:
        if (len - 2) % 4 == 0:
            rec = a^b
        else:
            rec = a^1^b
    else:
        if (len - 1) % 4 == 0:
            rec = a
        else:
            rec = a^1
print(rec) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b rec = 0 rec 0 len = b - a + 1 len b - a + 1 b - a b a 1 if a % 2 == 0:
    if len % 2 == 1:
        if (len - 1) % 4 == 0:
            rec = b
        else:
            rec = 1^b
    else:
        if len % 4 == 0:
            rec = 0
        else:
            rec = 1
else:
    if len % 2 == 0:
        if (len - 2) % 4 == 0:
            rec = a^b
        else:
            rec = a^1^b
    else:
        if (len - 1) % 4 == 0:
            rec = a
        else:
            rec = a^1 a % 2 == 0 a % 2 a 2 0 if len % 2 == 1:
        if (len - 1) % 4 == 0:
            rec = b
        else:
            rec = 1^b
    else:
        if len % 4 == 0:
            rec = 0
        else:
            rec = 1 len % 2 == 1 len % 2 len 2 1 if (len - 1) % 4 == 0:
            rec = b
        else:
            rec = 1^b
     (len - 1) % 4 == 0 (len - 1) % 4 len - 1 len 1 4 0 rec = b rec b rec = 1^b rec 1^b 1 b if len % 4 == 0:
            rec = 0
        else:
            rec = 1 len % 4 == 0 len % 4 len 4 0 rec = 0 rec 0 rec = 1 rec 1 if len % 2 == 0:
        if (len - 2) % 4 == 0:
            rec = a^b
        else:
            rec = a^1^b
    else:
        if (len - 1) % 4 == 0:
            rec = a
        else:
            rec = a^1 len % 2 == 0 len % 2 len 2 0 if (len - 2) % 4 == 0:
            rec = a^b
        else:
            rec = a^1^b
     (len - 2) % 4 == 0 (len - 2) % 4 len - 2 len 2 4 0 rec = a^b rec a^b a b rec = a^1^b rec a^1^b a^1 a 1 b if (len - 1) % 4 == 0:
            rec = a
        else:
            rec = a^1 (len - 1) % 4 == 0 (len - 1) % 4 len - 1 len 1 4 0 rec = a rec a rec = a^1 rec a^1 a 1 print(rec) print rec rec = b b rec rec = a^1 a^1 rec rec = 0 0 rec rec = 0 0 rec rec = a^1^b a^1^b rec len = b - a + 1 b - a + 1 len rec = 1^b 1^b rec rec = a a rec rec = 1 1 rec a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b rec = a^b a^b rec
a, b = map(int, input().split())
rec = 0
len = b - a + 1
if a % 2 == 0:
    if len % 2 == 1:
        if (len - 1) % 4 == 0:
            rec = b
        else:
            rec = 1^b
    else:
        if len % 4 == 0:
            rec = 0
        else:
            rec = 1
else:
    if len % 2 == 0:
        if (len - 2) % 4 == 0:
            rec = a^b
        else:
            rec = a^1^b
    else:
        if (len - 1) % 4 == 0:
            rec = a
        else:
            rec = a^1
print(rec)