# 读取两个输入字符串
s = input().strip()
t = input().strip()

# 将第二个字符串中的字符转换为集合以便快速查找
chars_to_remove = set(t)

# 构建结果字符串,只保留不在第二个字符串中的字符
result = ''.join([char for char in s if char not in chars_to_remove])

# 输出结果
print(result)