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