for i, n, m in zip(range(int(input())), input().split(), input().split()): if n != m: print("{0}\n{1}\n{2}\n".format(i+1, n, m)) break