#include <bits/stdc++.h>
using namespace std;
int main() {
  int q = 0;
  cin >> q;
  while (q--) {
    int n = 0;
    cin >> n;
    vector<int> v(n), v1, v2;
    for (int i = 0; i < n; i++) cin >> v[i];
    int ind1 = 0, ind2 = n - 1;
    while (ind1 < ind2) {
      swap(v[ind1], v[ind2]);
      ind1++;
      ind2--;
    }
    for (int i = 0; i < n; i++) cout << v[i] << ' ';
    cout << endl;
  }
  return 0;
}
