#新建一个列表存储输入的好友
list1 = input()
#列表中字符串以空格间隔
list2 = list1.split(" ")
#创建一个对象存储输入删除的好友
name = input()
#从列表中删除
list2.remove(name)
print(list2)