#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long MAX = 1000004;
const long long INF = 1e18L + 5;
template <class T, class U>
void chmin(T &t, const U &u) {
  if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u) {
  if (t < u) t = u;
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
template <typename Arg1>
void pn(Arg1 &&arg1) {
  cout << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void pn(Arg1 &&arg1, Args &&...args) {
  cout << arg1 << "\n";
  pn(args...);
}
template <typename Arg1>
void ps(Arg1 &&arg1) {
  cout << arg1 << " ";
}
template <typename Arg1, typename... Args>
void ps(Arg1 &&arg1, Args &&...args) {
  cout << arg1 << " ";
  ps(args...);
}
template <typename Arg1>
void read(Arg1 &&arg1) {
  cin >> arg1;
}
template <typename Arg1, typename... Args>
void read(Arg1 &&arg1, Args &&...args) {
  cin >> arg1;
  read(args...);
}
long long g[MAX];
long long a[MAX];
void solve() {
  long long n;
  read(n);
  for (long long i = 0; i < n; ++i) read(a[i]);
  for (long long i = n - 1; i >= 0; --i) {
    ps(a[i]);
  }
  pn("");
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
}
