#include <bits/stdc++.h>
using namespace std;
int t;
int n;
int p[101];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (int i = 0; i < n; i++) {
      cout << p[n - 1 - i] << " ";
    }
    cout << endl;
  }
}
