#include <bits/stdc++.h>
using namespace std;
void start() {}
void solve() {
  int n;
  cin >> n;
  int* a = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    cout << a[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  start();
  long long int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
