#include <bits/stdc++.h>
using namespace std;
int main() {
  int v;
  cin >> v;
  while (v--) {
    int m;
    cin >> m;
    int b[m];
    for (int i = 0; i < m; ++i) cin >> b[i];
    for (int i = m - 1; i >= 0; i--) cout << b[i] << " ";
    cout << endl;
  }
  return 0;
}
