#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "NO\n";
  exit(0);
}
void yes() { cout << "YES\n"; }
int nxt() {
  int x;
  cin >> x;
  return x;
}
void solve() {
  int n = nxt();
  vector<int> a(n);
  for (int i = (int)0; i < (int)n; i++) cin >> a[i];
  for (int i = (int)n - 1; i >= (int)0; i--) cout << a[i] << " ";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int tc = 1; tc <= t; tc++) {
    solve();
  }
}
