#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int32_t main() {
  long long te;
  cin >> te;
  while (te--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long &i : a) cin >> i;
    reverse(a.begin(), a.end());
    for (long long i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
