r=input;print("\n".join([[str(i+1),n,m]for i,n,m in zip(range(int(r())),r().split(),r().split())if n!=m][0]))