#include <bits/stdc++.h>
using namespace std;
int z[105];
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> z[i];
    }
    for (int i = n; i >= 1; --i) {
      if (i == n)
        cout << z[i];
      else
        cout << " " << z[i];
    }
    cout << endl;
  }
}
