#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = (long long int)(0); i < (long long int)(n); i++)
    cin >> a[i];
  reverse(a, a + n);
  for (long long int i = (long long int)(0); i < (long long int)(n); i++)
    cout << a[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int tt;
  cin >> tt;
  while (tt--) solve();
}
