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