n, m, mm = input(), input().split(), input() a = [i for i in m if i != mm] for i in a: print(i, end=" ")