The Chinese writing system was developed about 4000 years ago, and it has changed relatively little since then. It consists of more than 40 thousand characters, where each character means a word or an idea. Spoken Chinese differs very much from region to region, but the written language is mostly the same. Thus writing acts as a unifying common language among the different regions.

Since over one billion people speak Chinese, it is of great practical importance to have a program that is capable of translating Chinese text to English. We have developed such a program, but it is not working perfectly. The problem is that Chinese can be written in two different ways: either the characters are written from left to right, or they are written vertically, with the columns going from right to left. The translator program is confused by these two possibilities: the translated English text is reversed. More precisely, the words follow each other in a left to right order, as they should, but the letters in a word go from right to left. Thus instead of the text `one two three' , the program produces `eno owt eerht'. Your job is to write a program that takes this reversed text, and outputs the correct translation.

Input

The input contains several blocks of test cases. Each case begins with a line containing an integer 1 n 100000, the number of lines in this test case. This is followed by n lines of text. The lengh of each line is at most 1000 characters. The only characters appearing on these lines are the lower case letters `a'-`z' and the space character. The input is terminated by a block with n = 0.

Output

For each test case, you have to output the n lines, with the words reversed. A word is a sequence of characters delimited by spaces, by the start of the line or by the end of the line. The spaces and new line characters have to be printed exactly as they appear in the input.

Sample Input

1
eno owt eerht
2
abcde   
aabb   cac x ab
0
Sample Output
one two three
edcba   
bbaa   cac x ba