#include <bits/stdc++.h>
using namespace std;
long long llmax = numeric_limits<long long>::max();
long long llmin = numeric_limits<long long>::min();
long long arr[100010] = {0}, ora[100010];
long long a[4], b[4];
char off[110][110];
int testar[100010];
vector<int> v[110];
vector<pair<int, pair<int, int>>> pv;
map<char, long long> mp;
priority_queue<int, vector<int>, greater<int>> pq;
priority_queue<pair<int, int>> pqr;
stack<char> st;
bool prime(long long num) {
  long long mid = sqrt(num);
  for (int i = 2; i <= mid; i++) {
    if (num % i == 0) return false;
  }
  return true;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      ora[n - i - 1] = arr[i];
    }
    for (int i = 0; i < n; i++) cout << ora[i] << " ";
    cout << endl;
  }
}
