for _ in range(int(input())):
    n = int(input())
    l = input().split()
    print(l[0])