#SDNU1513. K.Reversed Words
K.Reversed Words
Description
Some aliens are learning English. They have a very strange way in writing that they revered every word in the sentence but keep all the words in common order. For example when they want to write “one two three”, they will write down “eno owt eerht”.
Now we’ve got some sentence written by these aliens, translate them! And maybe we will know some of their secrets!
Input
Multiple test cases. The first line contains a positive integer , indicating the number of test cases.
For each test cases, there will be one line contains only lower case letters and spaces. The length of each line will be no more than . Test cases which are longer than will be less than . Continuous letters are seen as a word, words are separated by spaces. There won’t be two adjacent spaces in the input. Space won’t be the first or the last character.
Output
One line per case, the translated sentence.
Sample Input
2
eno owt eerht
abcde
Sample Output
one two three
edcba