print(*[[i+1, s, t] for i, s, t in zip(range(int(input())), input().split(), input().split()) if s != t][0], sep="\n")