#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 0;
  cin >> t;
  while (t--) {
    long long n = 0, i = 0, x = 0;
    vector<long long> p;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> x;
      p.push_back(x);
    }
    for (i = n - 1; i >= 0; i--) cout << p[i] << " ";
    cout << "\n";
  }
  return 0;
}
