n = int(input()) s = input().split() t = input().split() array = [index for index,(i,j) in enumerate(zip(s,t)) if i!=j][0] print(array+1) print(s[array]) print(t[array])