Doraemon gave Nobita a gadget that swaps words inside a string in the following manner :

If there are W words, word 1 is swapped with word W, word 2 is swapped with word W-1 and so on.
The problem is that Nobita himself cannot verify the answer for large strings. Help him write a program to do so.

INPUT : 
the first line of the input contains the number of test cases. Each test case consists of a single line containing the string.

OUTPUT :
output the string with the words swapped as stated above.

CONSTRAINTS :
|string length| ≤ 100000
string contains english alphabets and spaces

SAMPLE INPUT
1
hello world

SAMPLE OUTPUT
world hello
num_cases = int(raw_input().rstrip("\n"))
for count in range(num_cases):
    input = raw_input().rstrip("\n")
    words = input.split(" ")
    start = 0
    end = len(words) - 1
    for k in range(len(words) / 2):
        temp = words[start]
        words[start] = words[end]
        words[end] = temp
        start = start + 1
        end = end - 1
    print " ".join(words)