#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i <= n - 1; i++) cin >> arr[i];
  reverse(arr.begin(), arr.end());
  for (int i = 0; i <= n - 1; i++) cout << arr[i] << " \n"[i == n - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int tt;
  cin >> tt;
  while (tt--) solve();
}
