#include <bits/stdc++.h>
using namespace std;
vector<long long int> read(long long int n) {
  vector<long long int> a;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    a.push_back(x);
  }
  return a;
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> a = read(n);
    reverse(a.begin(), a.end());
    for (auto x : a) {
      cout << x << " ";
    }
  }
  return 0;
}
