A,B=map(int,input().split())
B+=1
Abit=[0]*41
for j in range(41):
    bitp=A//(2*(2**j))
    bitm=A%(2*(2**j))
    Abit[j]+=bitp*(2**j)
    Abit[j]+=max(0,bitm-2**j)
Bbit=[0]*41
for j in range(41):
    bitp=B//(2*(2**j))
    bitm=B%(2*(2**j))
    Bbit[j]+=bitp*(2**j)
    Bbit[j]+=max(0,bitm-2**j)
res=0
for j in range(41):
    Bbit[j]-=Abit[j]
    res+=(Bbit[j]%2)*(2**j)
print(res) A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B B+=1 B 1 Abit=[0]*41 Abit [0]*41 [0] 0 41 for j in range(41):
    bitp=A//(2*(2**j))
    bitm=A%(2*(2**j))
    Abit[j]+=bitp*(2**j)
    Abit[j]+=max(0,bitm-2**j) j range(41) range 41 bitp=A//(2*(2**j)) bitp A//(2*(2**j)) A 2*(2**j) 2 2**j 2 j bitm=A%(2*(2**j)) bitm A%(2*(2**j)) A 2*(2**j) 2 2**j 2 j Abit[j]+=bitp*(2**j) Abit[j] Abit j bitp*(2**j) bitp 2**j 2 j Abit[j]+=max(0,bitm-2**j) Abit[j] Abit j max(0,bitm-2**j) max 0 bitm-2**j bitm 2**j 2 j Bbit=[0]*41 Bbit [0]*41 [0] 0 41 for j in range(41):
    bitp=B//(2*(2**j))
    bitm=B%(2*(2**j))
    Bbit[j]+=bitp*(2**j)
    Bbit[j]+=max(0,bitm-2**j) j range(41) range 41 bitp=B//(2*(2**j)) bitp B//(2*(2**j)) B 2*(2**j) 2 2**j 2 j bitm=B%(2*(2**j)) bitm B%(2*(2**j)) B 2*(2**j) 2 2**j 2 j Bbit[j]+=bitp*(2**j) Bbit[j] Bbit j bitp*(2**j) bitp 2**j 2 j Bbit[j]+=max(0,bitm-2**j) Bbit[j] Bbit j max(0,bitm-2**j) max 0 bitm-2**j bitm 2**j 2 j res=0 res 0 for j in range(41):
    Bbit[j]-=Abit[j]
    res+=(Bbit[j]%2)*(2**j) j range(41) range 41 Bbit[j]-=Abit[j] Bbit[j] Bbit j Abit[j] Abit j res+=(Bbit[j]%2)*(2**j) res (Bbit[j]%2)*(2**j) Bbit[j]%2 Bbit[j] Bbit j 2 2**j 2 j print(res) print res A,B=map(int,input().split()) map(int,input().split()) A B=map(int,input().split()) map(int,input().split()) B bitp=B//(2*(2**j)) B//(2*(2**j)) bitp bitm=B%(2*(2**j)) B%(2*(2**j)) bitm res=0 0 res bitp=A//(2*(2**j)) A//(2*(2**j)) bitp B+=1 1 B Bbit=[0]*41 [0]*41 Bbit bitm=A%(2*(2**j)) A%(2*(2**j)) bitm Abit=[0]*41 [0]*41 Abit res+=(Bbit[j]%2)*(2**j) (Bbit[j]%2)*(2**j) res
A,B=map(int,input().split())
B+=1
Abit=[0]*41
for j in range(41):
    bitp=A//(2*(2**j))
    bitm=A%(2*(2**j))
    Abit[j]+=bitp*(2**j)
    Abit[j]+=max(0,bitm-2**j)
Bbit=[0]*41
for j in range(41):
    bitp=B//(2*(2**j))
    bitm=B%(2*(2**j))
    Bbit[j]+=bitp*(2**j)
    Bbit[j]+=max(0,bitm-2**j)
res=0
for j in range(41):
    Bbit[j]-=Abit[j]
    res+=(Bbit[j]%2)*(2**j)
print(res)
