import sys

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