#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int64_t dr8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int64_t dc8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int64_t dr4[] = {1, 0, 0, -1};
int64_t dc4[] = {0, 1, -1, 0};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int64_t i, n, j, m, k, l, t;
  int64_t x;
  cin >> x;
  while (x--) {
    cin >> n;
    vector<int64_t> v(n);
    for (i = 0; i < n; i++) cin >> v[i];
    for (i = 0; i < n / 2; i++) {
      k = v[i];
      v[i] = v[n - 1 - i];
      v[n - 1 - i] = k;
    }
    for (i = 0; i < n; i++) cout << v[i] << " ";
    cout << endl;
  }
}
