P7674 [COCI 2013/2014 #5] EKSPLOZIJA
Description
Given a string and a target string, find all occurrences of the target string in the given string and delete them.
Concatenate the remaining small pieces in their original order, and then keep performing this operation on the remaining string until no more occurrences of the target string appear.
Print the remaining string. If nothing remains, output `FRULA`.
Input Format
The first line contains a string, which is the original string.
The second line contains a string, which is the target string.
Output Format
One line containing a string, which is the remaining string.
Explanation/Hint
**[Sample Explanation #1]**
After the first deletion, the original string becomes `mirkov**nizC**4` (`*` indicates deleted characters), i.e. `mirkovnizC4`.
After the second deletion, the string becomes `mirkovniz**`, i.e. `mirkovniz`.
**[Sample Explanation #2]**
After the first deletion, the original string becomes `****1****2ab` (`*` indicates deleted characters), i.e. `12ab`.
After the second deletion, the string becomes `****`. Therefore output `FRULA`.
**[Constraints]**
For $50\%$ of the testdata, $1\le$ the original string length $\le 3000$.
For $100\%$ of the testdata, $1\le$ the original string length $\le 10^6$, $1\le$ the target string length $\le 36$. All strings consist of uppercase letters, lowercase letters, and digits $0,1...9$. It is guaranteed that there are no repeated characters in the target string.
**[Notes]**
The score of this problem follows the original COCI setting, with a full score of $100$.
Translated from [COCI2013_2014](https://hsin.hr/coci/archive/2013_2014/) [CONTEST #5](https://hsin.hr/coci/archive/2013_2014/contest5_tasks.pdf) _**T3 EKSPLOZIJA**_.
Translated by ChatGPT 5