#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  cin.ignore();
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &it : a) cin >> it;
    reverse(a.begin(), a.end());
    for (int i : a) cout << i << " ";
    cout << '\n';
  }
}
