n, l1, l2 = int(input()), input().split(), input().split() for i in range(n): if l1[i] != l2[i]: print(f"{i+1}\n{l1[i]}\n{l2[i]}") break