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