def main(): N = int(input()) S = list(input().split()) T = list(input().split()) for idx, (s, t) in enumerate(zip(S, T), 1): if s != t: print(idx) print(s) print(t) return if __name__ == "__main__": main()