#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
int val[maxn];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) scanf("%d", &val[i]);
    reverse(val, val + n);
    for (int i = 0; i < n; ++i) cout << val[i] << " ";
    cout << endl;
  }
  return 0;
}
