eolymp
bolt
Try our new interface for solving problems
Problems

Censoring (Bronze)

Censoring (Bronze)

Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions. Unfortunately, the latest issue contains a rather inappropriate article on how to cook the perfect steak, which FJ would rather his cows not see (clearly, the magazine is in need of better editorial oversight).

FJ has taken all of the text from the magazine to create the string s of length at most 106 characters. From this, he would like to remove occurrences of a substring t of length <= 100 characters to censor the inappropriate content. To do this, Farmer John finds the first occurrence of t in s and deletes it. He then repeats the process again, deleting the first occurrence of t again, continuing until there are no more occurrences of t in s. Note that the deletion of one occurrence might create a new occurrence of t that didn't exist before.

Please help FJ determine the final contents of s after censoring is complete.

Input

The first line will contain s. The second line will contain t. The length of t will be at most that of s, and all characters of s and t will be lower-case alphabet characters (in the range a..z).

Output

Print the string s after all deletions are complete. It is guaranteed that s will not become empty during the deletion process.

Time limit 1 second
Memory limit 128 MiB
Input example #1
whatthemomooofun
moo
Output example #1
whatthefun
Source 2015 USACO February, Bronze