N = int(input()) S = list(input().split()) T = list(input().split()) for (i, s, t) in [(a, b, c) for a, (b, c) in enumerate(zip(S, T))]: if s != t: print(i + 1) print(s) print(t)