t=int(input())

for i in range(t):
    n=input()
    print(input().replace(' ','')[::-1])