#include <bits/stdc++.h>
using namespace std;
int T, a, b, n;
void solve() {
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  reverse(v.begin(), v.end());
  for (int i = 0; i < n; i++) cout << v[i] << " ";
  cout << endl;
}
int main() {
  cin >> T;
  int i = 1;
  while (T--) {
    solve();
  }
  return 0;
}
