#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
long long mypow(int x, int y) {
  long long res = 1;
  for (int i = 1; i <= y; i++) res *= x;
  return res;
}
long long gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int getlen(char s[]) {
  int res = 0;
  for (int i = 1; s[i] != '\0'; i++) res++;
  return res;
}
long long qmi(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
const int N = 110;
int a[N];
int n;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    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]);
    printf("\n");
  }
}
int main() {
  solve();
  return 0;
}
