#include <bits/stdc++.h>
using namespace std;
void Solve() {
  long long n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  reverse(arr.begin(), arr.end());
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
}
int main() {
  long long t;
  cin >> t;
  while (t--) Solve();
  return 0;
}
