'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''
import math 
#print(math.gcd(4,2))
t=int(input())
for i in range(t):
    n=int(input())
    l=list(map(int,input().split()))
    print(math.gcd(4,2))
