#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long int dx[] = {0, 1, -1, 0};
long long int dy[] = {1, 0, 0, -1};
const long long int N = (long long int)(2 * 1e5 + 10);
map<long long int, long long int> x;
map<long long int, long long int> y;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T;
  cin >> T;
  while (T--) {
    long long int n;
    cin >> n;
    long long int *a = new long long int[n];
    ;
    for (long long int i = 0; i < n; i++) cin >> a[i];
    for (long long int i = n - 1; i >= 0; i--) cout << a[i] << " ";
    cout << "\n";
  }
}
