Problem 3: Phenomena!
Background:
Ah, the "Muppet Show". Undoubtedly one of the best shows ever produced.
Kermit, Fozzie, Gonzo, Miss Piggy, Dr. Teeth, Animal, Statler and Waldorf
and all the rest of the characters are instantly recognizable to most people.
In addition to great sketches, they also had amusing songs. One of
them was the "Mahna Mahna" song sung by Mahna Mahna and the Snowths.
Mahna Mahna was sorta cross between Dr. Teeth and Animal and, well, pretty
much
lived in his own little world. Everytime he said "Mahna Mahna" (which
sounds alot like phenomena), the Snowths (which looked sorta like talking
rocks) would reply with some variation
of "do doo do do". Actually, the first time he says it, the Snowths
reply with "do doo do do". The second time they reply with "do do do do".
Finally, the third time they reply "dodo dodo do do do dodo". They then
cycle through those responses. Obviously, it's not an exact translation,
but I digress. Later on, when the "Muppets Tonight" was airing, one of
the sketches had Kermit talking to a psychiatrist (played by Sandra Bullock)
where he complained that everytime someone said the word "Phenomena",
he heard the Snowths go with their responses.
We'll take the Kermit version. So everytime phenomena gets said, you have
to insert the appropriate responses.
Input:
There will be only one test case, terminated by end of file. The test
case consists of a bunch of text. Any time the word phenomena appears
(in any capitalization), you are to insert the appropriate response by
the Snowths in parentheses. The only punctuation that appears in the
text will be ., ?, !, and (comma). No word will be continued onto
the next line. No line will be more than 80 characters. There is always
one space between words or after a punctuation.
Output:
Echo back the input, except add in the appropriate responses by the
Snowths. Nothing else should be changed. The Snowths response always
come before any punctuation.
Sample Input:
Phenomena!
mah mama na mahna mah namwomp mwomp
ma mo mo mana mo. phenomena phenomena
PHenomena!
Is there such a word as phenomenaism?
Sample Output:
Phenomena (do doo do do)!
mah mama na mahna mah namwomp mwomp
ma mo mo mana mo. phenomena (do do do do) phenomena (dodo dodo do do do dodo)
PHenomena (do doo do do)!
Is there such a word as phenomenaism?