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