#include<iostream>
using std::cout;
using std::cin;
int main()
{
unsigned short int t;
cin >> t;
while(t--)
{
unsigned short int n;
cin >> n;
int *tab=new int[n];
for(unsigned short i=0;i<n;i++)
{
cin >> tab[i];
}
for(signed short i=(n-1);i>=0;i--)
{
cout << tab[i] << " ";
}
cout << "\n";
delete [] tab;
tab=0;
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIHN0ZDo6Y291dDsKdXNpbmcgc3RkOjpjaW47CmludCBtYWluKCkKewogICAgICAgIHVuc2lnbmVkIHNob3J0IGludCB0OwogICAgICAgIGNpbiA+PiB0OwogICAgICAgIHdoaWxlKHQtLSkKICAgICAgICB7CiAgICAgICAgICAgICAgICB1bnNpZ25lZCBzaG9ydCBpbnQgbjsKICAgICAgICAgICAgICAgIGNpbiA+PiBuOwogICAgICAgICAgICAgICAgaW50ICp0YWI9bmV3IGludFtuXTsKICAgICAgICAgICAgICAgIGZvcih1bnNpZ25lZCBzaG9ydCBpPTA7aTxuO2krKykKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgY2luID4+IHRhYltpXTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGZvcihzaWduZWQgc2hvcnQgaT0obi0xKTtpPj0wO2ktLSkKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgY291dCA8PCB0YWJbaV0gPDwgIiAiOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgY291dCA8PCAiXG4iOwogICAgICAgICAgICAgICAgZGVsZXRlIFtdIHRhYjsKICAgICAgICAgICAgICAgIHRhYj0wOwogICAgICAgIH0KICAgICAgICByZXR1cm4gMDsKfQ==