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