n=input() s=input().split() t=input().split() for i,g in enumerate(s): if g!=t[i]: print(i+1,g,t[i],sep='\n');exit()