#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int test = 1;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    int p[n];
    for (int i = 0; i < n; ++i) cin >> p[i];
    for (int i = n - 1; i >= 0; --i) {
      cout << p[i] << " ";
    }
    cout << endl;
  }
}
