#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a;
    vector<int> v;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a;
      v.push_back(a);
    }
    reverse(v.begin(), v.end());
    for (int i = 0; i < n; i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  }
}
