Problem: 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

Solution (in PYTHON):

Solution:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
t=raw_input()
t=int(t)
while t>0:
	s=raw_input()
	l=s.split()
	length=len(l)
	for i in range(0,length/2):
		l[i],l[-(i+1)]=l[-(i+1)],l[i]
	res=""
	for e in l:
		res=res+e+" "
	print res
	t-=1