#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  for (int c = 0; c < t; c++) {
    int n;
    scanf("%d", &n);
    int *arr = new int[n];
    for (int i = n - 1; i >= 0; i--) {
      scanf("%d", &arr[i]);
    }
    for (int i = 0; i < n; i++) {
      printf("%d", arr[i]);
      if (i + 1 < n)
        printf(" ");
      else
        printf("\n");
    }
  }
}
