n = int(input()) lst1 = list(input().split()) lst2 = list(input().split()) for i in range(n): if lst1[i]!=lst2[i]: print(i+1) print(lst1[i]) print(lst2[i]) break