names = input('').split(' ')
name_remove = input('')
for i in names:
    if i == name_remove:
        names.remove(i)
print(names)