#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int n;
  cin >> t;
  while (t--) {
    int x = -1;
    cin >> n;
    vector<int> v(n);
    for (auto &it : v) cin >> it;
    for (int i = 0; i < n / 2; i++) {
      int temp = v[n - i - 1];
      v[n - i - 1] = v[i];
      v[i] = temp;
    }
    for (int i = 0; i < n; i++) cout << v[i] << "\t";
    cout << "\n";
  }
}
