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