n=int(input())
list1=list(map(int,input().split(' ')))
x=int(input())
while list1.count(x):
    list1.remove(x)
print(*list1)