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