N=int(input()) S=list(input().split()) T=list(input().split()) for i in range(N): if S[i]!=T[i]: print(str(i+1)+"\n"+S[i]+"\n"+T[i])