#include <bits/stdc++.h>
using namespace std;
struct node {
  long long ct, s, mx;
  node() { ct = s = mx = 0; }
};
struct cmp {
  bool operator()(long long a, long long b) const { return a > b; }
};
long long n, m, k;
void solve() {
  long long i, j, x, y, z;
  cin >> n;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  reverse(a.begin(), a.end());
  for (i = 0; i < n; i++) cout << a[i] << " ";
  ;
  cout << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) solve();
}
