n = int(input()) a = input().split() b = input().split() for i, v in enumerate(a, start=1): if not v in b: print(i) print(v) for i, v in enumerate(b): if not v in a: print(v)