Задачі
Software Bugs
Software Bugs
\includegraphics{https://static.e-olymp.com/content/df/dfbfc96807179394df9f53e140fb6fa02070eac0.jpg}
Not all bugs are insects. There are also certain kinds of bugs that may become a real nightmare for software developers. You definitely know the situation when a user calls to say “Hey, I’ve found a bug in your program.” Once you have located and removed the bug, another one appears immediately. It is a hard and never-ending process.
Recently, there appeared a promising open-source initiative called the Bug Preprocessor. The preprocessor is a program able to find all bugs in your source code and mark them, so they are relatively easy to remove. Your task is to write a program that will remove all marked bugs from the preprocessed source code.
\InputFile
The input contains several test cases. Each test case starts with a line containing one integer number \textbf{T} (\textbf{0} ≤ \textbf{T} ≤ \textbf{100000}), one space and a string \textbf{B} used by the preprocessor to mark all bugs. The next \textbf{T} lines then contain the preprocessed source code. All bugs are represented by a case-sensitive string \textbf{B}. Each line of the input will be between \textbf{0} and \textbf{2000000} characters long. The bug marker \textbf{B} consists of at least \textbf{1} and at most \textbf{1000} uppercase letters ("\textbf{A}" through "\textbf{Z}").
\OutputFile
Your program must remove all of the bugs and produce the same result as if the first occurrence of \textbf{B} on each line was removed repeatedly, until there is no other existing occurrence of \textbf{B}. Nothing else may be removed, not even spaces.
Вхідні дані #1
7 BUG print "No bugs here..." void hello() { BUGBUG printfBUG("Hello, world!\n"); } 1 ERR wriERRERRtelERRn("Hello E-R-R");
Вихідні дані #1
print "No bugs here..." void hello() { printf("Hello, world!\n"); } writeln("Hello E-R-R");