|
|||
Decoding the MessageChico and Maria are relatives who live in different towns. As they both live in a rural area, it is very difficult for them to keep in touch. One way they found to overcome their communication problem is to send messages through their parents who often visit each other. The point is that Chico and Maria do not want their parents to read their messages, so they decided to create a secret code for the messages. The code is not very sophisticated, but you should keep in mind that Chico and Maria are just children. In general, the meaning of a message is based on a letter of each word in it. The decoded message is formed by taking the first letter of the first word, the second letter of the second word, and so on. If a word does not have enough letters, the following word should be used. For example, if you are analyzing the third word, you should consider its third letter, but if it has only two letters, then you should try to form a decoded word with the third letter of the fourth word. When the end of a line is reached, you should finish decoding the current word and start to form the next one from the first letter of the first word in the next line. Your task is to translate a message according to Chico and Maria's secret code. Input Specification
The first line of the input gives the number of test cases, T
(1 ≤ T ≤ 30), then there is a blank line before the
first test case. Each test case represents a message, which is composed of N lines
(1 ≤ N ≤ 100), and each line is composed of
M words (1 ≤ M ≤ 30). Two words in the same
line are separated by one or more whitespaces. A word is formed by the letters
Output SpecificationFor each test case, you must print the number of the test case and each word of the decoded message, one per line (look at the sample output for the exact format). You must print a blank line between consecutive test cases. Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |