#include <bits/stdc++.h>
const long long inf = 1e9;
const long long cont = 1e18;
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  reverse(v.begin(), v.end());
  for (long long i = 0; i < n; i++) cout << v[i] << " ";
  cout << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long tst;
  cin >> tst;
  while (tst--) solve();
  return 0;
}
