#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0, n = 0, m = 0, a = 0, b = 0, k = 0, x = 0, odd = 0, even = 0;
  cin >> t;
  while (t--) {
    cin >> n;
    long long v[n + 1];
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
    }
    for (long long i = n - 1; i >= 0; i--) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
