#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int nTests, n;
  cin >> nTests;
  while (nTests--) {
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    for (int i = n - 1; i >= 0; i--) cout << arr[i] << " ";
    cout << endl;
  }
  return 0;
}
