ZOJ Problem Set - 1172
Bob is a nice looking lucky guy and his only major problem is that he does
not read very much and as so he is absolutely illiterate. He is not fond of
all those commas, spelling, grammar etc. Now he is introducing a college and
has to take literacy examination. He was spoken the sentence and has to write
it down correctly. Of course, he has a problem doing that. As lucky guy Bob
is lucky this time as well. The examination has a form of computer test and
he has unlimited number of attempts to try. There are some places in the sentence
Bob is unsure about. He has several variants for each of them and as so there
could be quite a large number of variants of the whole sentence. Your goal is
to help Bob and write the program that produces all different variants of the
whole sentence based on Bob's assumptions on its parts.
The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.
The output format consists of N output blocks. There is a blank line between output blocks.
It's [|a] b[i|ee]g problem to write correct sentences.