#include <bits/stdc++.h>
int n, a[10005];
void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = n; i >= 1; i--) printf("%d ", a[i]);
  puts("");
  return;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
