#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238463;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int temp;
      cin >> temp;
      v.push_back(temp);
    }
    reverse(v.begin(), v.end());
    for (auto alpha : v) cout << alpha << " ";
    cout << "\n";
  }
  return 0;
}
