#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, i, j, k;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<long long> a(n);
    for (auto &x : a) cin >> x;
    for (i = n - 1; i >= 0; i--) cout << a[i] << " ";
    cout << '\n';
  }
  return 0;
}
