import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) S = 0 X = 0 r = 0 ans = 0 acc = [0] for Bi in B: acc.append(acc[-1]^Bi) acc_acc = [acc[0]] for acc_i in acc[1:]: acc_acc.append(acc_acc[-1]+acc_i) ans = 0 for l in range(N): while r