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

answer = 0
X = A - 1
Y = B
answer = 0
for i in range(1,41):
    cycle = 2 ** i
    qX = X // cycle
    qY = Y // cycle
    rX = X % cycle
    rY = Y % cycle
    oneX = qX * cycle // 2
    oneY = qY * cycle // 2
    if rX >= cycle // 2:
        oneX += rX - cycle // 2 + 1
    if rY >= cycle // 2:
        oneY += rY - cycle // 2 + 1
    one = oneY - oneX

    if one % 2 == 1 :
        answer += 2 ** (i - 1)
    
print(answer) A,B = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split B answer = 0 answer 0 X = A - 1 X A - 1 A 1 Y = B Y B answer = 0 answer 0 for i in range(1,41):
    cycle = 2 ** i
    qX = X // cycle
    qY = Y // cycle
    rX = X % cycle
    rY = Y % cycle
    oneX = qX * cycle // 2
    oneY = qY * cycle // 2
    if rX >= cycle // 2:
        oneX += rX - cycle // 2 + 1
    if rY >= cycle // 2:
        oneY += rY - cycle // 2 + 1
    one = oneY - oneX

    if one % 2 == 1 :
        answer += 2 ** (i - 1)
     i range(1,41) range 1 41 cycle = 2 ** i cycle 2 ** i 2 i qX = X // cycle qX X // cycle X cycle qY = Y // cycle qY Y // cycle Y cycle rX = X % cycle rX X % cycle X cycle rY = Y % cycle rY Y % cycle Y cycle oneX = qX * cycle // 2 oneX qX * cycle // 2 qX * cycle qX cycle 2 oneY = qY * cycle // 2 oneY qY * cycle // 2 qY * cycle qY cycle 2 if rX >= cycle // 2:
        oneX += rX - cycle // 2 + 1
     rX >= cycle // 2 rX cycle // 2 cycle 2 oneX += rX - cycle // 2 + 1 oneX rX - cycle // 2 + 1 rX - cycle // 2 rX cycle // 2 cycle 2 1 if rY >= cycle // 2:
        oneY += rY - cycle // 2 + 1
     rY >= cycle // 2 rY cycle // 2 cycle 2 oneY += rY - cycle // 2 + 1 oneY rY - cycle // 2 + 1 rY - cycle // 2 rY cycle // 2 cycle 2 1 one = oneY - oneX one oneY - oneX oneY oneX if one % 2 == 1 :
        answer += 2 ** (i - 1)
     one % 2 == 1 one % 2 one 2 1 answer += 2 ** (i - 1) answer 2 ** (i - 1) 2 i - 1 i 1 print(answer) print answer A,B = list(map(int,input().split())) list(map(int,input().split())) A cycle = 2 ** i 2 ** i cycle oneY = qY * cycle // 2 qY * cycle // 2 oneY Y = B B Y one = oneY - oneX oneY - oneX one answer += 2 ** (i - 1) 2 ** (i - 1) answer qX = X // cycle X // cycle qX answer = 0 0 answer qY = Y // cycle Y // cycle qY oneX = qX * cycle // 2 qX * cycle // 2 oneX X = A - 1 A - 1 X rY = Y % cycle Y % cycle rY oneY += rY - cycle // 2 + 1 rY - cycle // 2 + 1 oneY answer = 0 0 answer B = list(map(int,input().split())) list(map(int,input().split())) B oneX += rX - cycle // 2 + 1 rX - cycle // 2 + 1 oneX rX = X % cycle X % cycle rX
A,B = list(map(int,input().split()))

answer = 0
X = A - 1
Y = B
answer = 0
for i in range(1,41):
    cycle = 2 ** i
    qX = X // cycle
    qY = Y // cycle
    rX = X % cycle
    rY = Y % cycle
    oneX = qX * cycle // 2
    oneY = qY * cycle // 2
    if rX >= cycle // 2:
        oneX += rX - cycle // 2 + 1
    if rY >= cycle // 2:
        oneY += rY - cycle // 2 + 1
    one = oneY - oneX

    if one % 2 == 1 :
        answer += 2 ** (i - 1)
    
print(answer)