from numpy import *;i=int32;p=input;q=searchsorted;N=int(p());A=i(p().split());B=i(p().split());c=0;
for k in range(1,30):
  a,b=sort(hstack((A%(1<<k),A%(1<<k)-2**k))),B%(1<<k);c+=((sum(q(a,2**k-b)-q(a,2**(k-1)-b)))&1)<<k-1
print(c)
