In the age of knights, the nerve to shrug off a wicked insult mattered a great deal.
King Hyunwoo did not want his servants to fold under an insult, so he used his considerable coding skill to build a taunt bot for training.
He had not taken the artificial intelligence course yet, and chapter 1 of automata theory was all he knew, so the best he could manage was a bot that always does the same thing when it reads the same input in the same state.
The taunt bot follows the grammar below and the rules that come after it.
<taunt> ::= <sentence> | <taunt> <sentence> | <noun>! | <sentence>
<sentence> ::= <past-rel> <noun-phrase> | <present-rel> <noun-phrase> | <past-rel> <article> <noun>
<noun-phrase> ::= <article> <modified-noun>
<modified-noun> ::= <noun> | <modifier> <noun>
<modifier> ::= <adjective> | <adverb> <adjective>
<present-rel> ::= your <present-person> <present-verb>
<past-rel> ::= your <past-person> <past-verb>
<present-person> ::= steed | king | first-born
<past-person> ::= mother | father | grandmother | grandfather | godfather
<noun> ::= hamster | coconut | duck | herring | newt | peril | chicken | vole | parrot | mouse | twit
<present-verb> ::= is | "masquerades as"
<past-verb> ::= was | personified
<article> ::= a
<adjective> ::= silly | wicked | sordid | naughty | repulsive | malodorous | ill-tempered
<adverb> ::= conspicuously | categorically | positively | cruelly | incontrovertibly
A phrase inside double quotes always counts as one word.
If the grammar above is unfamiliar, read about Backus-Naur form.
The bot reads that grammar and taunts by these rules.
<taunt> and expands recursively. Look closely and <taunt> can produce another <taunt>, which puts two taunts on one line, and such a line counts as two taunts. If the opponent said 4 words and the bot put two taunts on one line, the bot is done.The first taunt is built like this.
<taunt>
=> <sentence>
=> <past-rel> <noun-phrase>
=> your <past-person> <past-verb> <article> <modified-noun>
=> your mother was a <noun>
=> your mother was a hamster
The second taunt begins like this.
<taunt>
=> <taunt> <sentence>
=> <noun>! <present-rel> <noun-phrase>
=> ...
One more rule always applies. If the 12 letters t, h, e, h, o, l, y, g, r, a, i, l appear in that order inside the line the opponent said, ignoring case and allowing other characters in between, the first taunt for that line is (A childish hand gesture). That taunt skips the grammar, so it changes no symbol's choice state, and it counts as one taunt.
King Hyunwoo will train his servants with this bot. Simulate what the taunt bot does.
The input is several lines, and each line is what the bot's opponent said. Process every line until the input ends.
Each line holds only English letters, digits, ,.-!? and spaces, and its length is between 1 and 72 characters.
Tokens are separated from each other by one or more spaces. No line without a word is given.
For each input line, print the following in order.
Knight:, then that line's tokens in input order.Taunter: and continues with the taunt and a single period.Every token you print is followed by exactly one space (ASCII 32). A Knight: line and a Taunter: line therefore end with a single space, and tokens sit one space apart no matter how many spaces separated them in the input.
Strip the whitespace and the empty line left at the very end of the whole output. The last Taunter: line therefore ends with its period and a single newline.
A taunt starts with a capital letter. When one line carries two taunts, both start with a capital letter. A phrase inside double quotes counts as one word, and the double quotes are not printed.