n = int(input()) x = list(map(int,input().split())) a = list(map(int,input().split())) b = [0]; c = [0]; i = s = 0 for v in a: b.append(b[-1]^v); c.append(c[-1]+v) while i