#K14681. Censor Text

    ID: 24189 Type: Default 1000ms 256MiB

Censor Text

Censor Text

Given a string and a list of taboo words, you are required to censor the text by replacing every occurrence of each taboo word with a series of asterisks (*) having the same length as the word. The matching should be case insensitive and must only replace whole words. Punctuation attached to words should remain unchanged. Note that we treat word boundaries in accordance with the LaTeX notation \b\b. For example, if the input text is "The quick brown fox jumps over the lazy dog." and the taboo words are ["quick", "dog"], the correct output is "The ***** brown fox jumps over the lazy ***."

inputFormat

The input is read from standard input (stdin). The first line contains the text (which may include spaces and punctuation). The second line contains an integer n, representing the number of taboo words. This is followed by n lines, each containing one taboo word.

outputFormat

Print the censored text to standard output (stdout).## sample

The quick brown fox jumps over the lazy dog.
2
quick
dog
The ***** brown fox jumps over the lazy ***.