#include <bits/stdc++.h>
using namespace std;
const long long N = 666666, mod = 1e9 + 7;
long long n, arr[N];
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> arr[i];
    for (long long i = n; i >= 1; i--) cout << arr[i] << " ";
    cout << '\n';
  }
  return 0;
}
