dummy = input()
list = list(map(int,input().split()))
num = int(input())

while 1:
    try:
        list.remove(num)
    except:
        break

for i in list:
    print(i,end=' ')