#include <bits/stdc++.h>
using namespace std;
int main() {
  long long tc;
  long long A[100000];
  long long B[100000];
  long long i;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> A[i];
    }
    for (long long i = n - 1; i >= 0; i--) {
      cout << A[i] << " ";
    }
    cout << endl;
  }
}
