#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> P(n);
  for (int i = 0; i < n; i++) cin >> P[i];
  for (int i = n - 1; i >= 0; i--) cout << P[i] << " ";
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
