Your task is to tidy up all the clutter (a list of forbidden words Ni) scattered around your room (a text string P).
Write a program that removes every occurrence of the strings Ni from the string P. More precisely, while P contains some Ni as a substring, repeat the following: take the shortest prefix of P that contains some Ni, and delete from it the shortest string Ni that this prefix contains.
The first line contains a string P consisting of digits and lowercase and uppercase English letters. The length of P is at most 105. Each of the following lines contains exactly one string Ni, also consisting of digits and lowercase and uppercase English letters. The total length of all strings Ni is at most 105.
Print, on a single line, what remains of P after all Ni have been removed. You may assume that the remaining length of P is always at least 1.