#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, i, t = 1, count = 0, sum = 0;
    cin >> n;
    int a[n];
    for (i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (i = n; i >= 1; i--) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
