#include <bits/stdc++.h>
using namespace std;
void run_case() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto &i : v) cin >> i;
  reverse(v.begin(), v.end());
  for (auto i : v) cout << i << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  for (int i = 1; i <= tc; i++) run_case();
  return 0;
}
