import sys

t = int(input())

for line in sys.stdin:
    n = int(line)
    s = input().split()
    new_s = "".join(s)
    print(new_s[::-1])