#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int* a = new int[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  reverse(a, a + n);
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
