N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) LIST=[[] for i in range(N+1)] for i in range(N): LIST[A[i]].append(i) now=0 for i in range(N): if B[i]==1: now^=(1<