Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
bisect_left = np.searchsorted
input()
a = np.int32(input().split())
b = np.int32(input().split())
ans = 0
for k in range(28, -1, -1):
    low = pow(2, k)
    high = pow(2, k + 1)
    a %= high
    b %= high
    b.sort()
    y = np.hstack((b - high, b))
    left = bisect_left(y, low - a)
    right = bisect_left(y, high - a)
    if sum(right - left) % 2:
        ans += low
print(ans)

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from numpy import array,searchsorted
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n]),array(t[n:])
    c=0
    for k in range(28,-1,-1):
        l,h=2**k,2**-~k
        a%=h
        b%=h
        b.sort()
        m=0
        for t in a:
            if l-t<0:
                i=searchsorted(b,(l-t)%h)-n
            else:
                i=searchsorted(b,l-t)
            j=searchsorted(b,h-t)
            m+=j-i
        c+=m%2*2**k
    print(c)
if __name__=='__main__':
    main()

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import*
from numpy import*
n=int(input())
a,b=eval('int64(input().split()),'*2)
c=0
for k in range(28,-1,-1):
    l,h=2**k,2**-~k
    a%=h
    b=sort(b%h)
    m=0
    for t in a:
        if l-t<0:
            i=bisect_left(b,(l-t)%h)-n
        else:
            i=bisect_left(b,l-t)
        j=bisect_left(b,h-t)
        m+=j-i
    c+=m%2*2**k
print(c)

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from numpy import*
n=int(input())
a,b=eval('int64(input().split()),'*2)
c=0
for k in range(28,-1,-1):
    l,h=2**k,2**-~k
    a%=h
    b=sort(b%h)
    m=0
    for t in a:
        i,j=searchsorted(b,l-t),searchsorted(b,h-t)
        if l-t<0:
            i=searchsorted(b,(l-t)%h)-n
        m+=j-i
    c+=m%2*2**k
print(c)

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import*
n,*t=map(int,open(0).read().split())
a,b=t[:n],t[n:]
c=0
for k in range(28,-1,-1):
    l,h=2**k,2**-~k
    a=[i%h for i in a]
    b=sorted(i%h for i in b)
    m=0
    for t in a:
        i,j=bisect_left(b,l-t),bisect_left(b,h-t)
        if l-t<0:
            i=bisect_left(b,(l-t)%h)-n
        m+=j-i
    c+=m%2*2**k
print(c)

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from bisect import bisect_left
    n,*t=map(int,open(0).read().split())
    c=0
    for k in range(30):
        b=sorted(i%2**-~k for i in t[n:])
        m=0
        for a in[i%2**-~k for i in t[:n]]:
            l,r=bisect_left(b,2**k-a),bisect_left(b,2**-~k-a)
            if 2**k-a<0:
                l=bisect_left(b,(2**k-a)%2**-~k)-n
            m+=r-l
        c+=m%2*2**k
    print(c)
if __name__=='__main__':
    main()

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from bisect import bisect_left
    n,*t=map(int,open(0).read().split())
    c=0
    for k in range(30):
        b=sorted(i%2**-~k for i in t[n:])
        m=0
        for a in[i%2**-~k for i in t[:n]]:
            l,r=bisect_left(b,2**k-a),bisect_left(b,2**-~k-a)
            if 2**k-a<0:
                l=bisect_left(b,(2**k-a)%2**-~k)-n
            m+=r-l
        c+=m%2*2**k
    print(c)
if __name__=='__main__':
    main()

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import*
n,*t=map(int,open(0).read().split())
c=0
for k in range(30):
    b=sorted(i%2**-~k for i in t[n:])
    m=0
    for a in[i%2**-~k for i in t[:n]]:
        l,r=bisect_left(b,2**k-a),bisect_left(b,2**-~k-a)
        if 2**k-a<0:
            l=bisect_left(b,(2**k-a)%2**-~k)-n
        m+=r-l
    c+=m%2*2**k
print(c)

Fixed submission:
def main():
    from numpy import array,searchsorted,sum,hstack
    n,*t=map(int,open(0).read().split())
    a,b=array(t[:n],'i4'),array(t[n:],'i4')
    c=0
    for k in range(28,-1,-1):
        l,h=pow(2,k),pow(2,k+1)
        a%=h
        b%=h
        b.sort()
        y=hstack((b-h,b))
        i=searchsorted(y,l-a)
        j=searchsorted(y,h-a)
        m=sum(j-i)
        c+=m%2*l
    print(c)
if __name__=='__main__':
    main()