#include <bits/stdc++.h>
using namespace std;
long long po(int a, int b) {
  if (b == 0) return 1;
  long long ans = 1;
  if (b % 2 == 0) {
    ans = po(a, b / 2) % 1000000007;
    ans = (ans % 1000000007 * ans % 1000000007) % 1000000007;
  } else {
    ans = po(a, (b - 1) / 2) % 1000000007;
    ans = (ans % 1000000007 * ans % 1000000007 * a) % 1000000007;
  }
  return ans % 1000000007;
}
void solve() {
  long long n, i;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = n - 1; i >= 0; i--) cout << a[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
}
