n = int(input()) s = input().split() t = input().split() for i in range(len(s)): if not s[i] == t[i]: print(i + 1) print(s[i]) print(t[i]) break