#include <bits/stdc++.h>
using namespace std;
const long long N = 20000000;
void Run() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long a[1000000];
int main() {
  Run();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = n - 1; i >= 0; i--) cout << a[i] << " ";
    cout << endl;
  }
}
