N = int(eval(input()))

A = list(map(int, input().split()))



As = sorted(A)

As = [a%As[0] if a%As[0] != 0 else As[0] for a in As]

As = sorted(As)



def judge(tmp_one, tmp_two):

    flg = 1



    while flg:

        if tmp_two%tmp_one == 0:

            tmp_two = tmp_one

        else:

            tmp_two = tmp_two%tmp_one



        if tmp_one%tmp_two == 0:

            tmp_one = tmp_two

        else:

            tmp_one = tmp_one%tmp_two

        if tmp_one == tmp_two:

            flg = 0



    return tmp_one



tmp_one = As[0]

for i in range(1, N):

    if i == N - 1:

        tmp_two = As[i]

    elif As[i] != As[0]:

        tmp_two = As[i]

        break



ans = judge(tmp_one, tmp_two)

print(ans)
N = int(eval(input()))

A = list(map(int, input().split()))





def gcd(n, m):

    if n < m:

        temp = n

        n = m

        m = temp

    

    def ecd(n, m):

        if n % m == 0:

            return m

        else:

            temp = n % m

            a = ecd(m, temp)

        return a

           

    return ecd(n, m)



temp = gcd(A[0], A[1])

for i in range(0, N-1):

    temp = gcd(temp, A[i])

    

print(temp)
N = int(eval(input()))
A = list(map(int, input().split()))
As = sorted(A)
As = [a % As[0] if a % As[0] != 0 else As[0] for a in As]
As = sorted(As)


def judge(tmp_one, tmp_two):
    flg = 1
    while flg:
        if tmp_two % tmp_one == 0:
            tmp_two = tmp_one
        else:
            tmp_two = tmp_two % tmp_one
        if tmp_one % tmp_two == 0:
            tmp_one = tmp_two
        else:
            tmp_one = tmp_one % tmp_two
        if tmp_one == tmp_two:
            flg = 0
    return tmp_one


tmp_one = As[0]
for i in range(1, N):
    if i == N - 1:
        tmp_two = As[i]
    elif As[i] != As[0]:
        tmp_two = As[i]
        break
ans = judge(tmp_one, tmp_two)
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))


def gcd(n, m):
    if n < m:
        temp = n
        n = m
        m = temp

    def ecd(n, m):
        if n % m == 0:
            return m
        else:
            temp = n % m
            a = ecd(m, temp)
        return a

    return ecd(n, m)


temp = gcd(A[0], A[1])
for i in range(0, N - 1):
    temp = gcd(temp, A[i])
print(temp)

-As = sorted(A) -As = [a % As[0] if a % As[0] != 0 else As[0] for a in As] -As = sorted(As) -def judge(tmp_one, tmp_two): -    flg = 1 -    while flg: -        if tmp_two % tmp_one == 0: -            tmp_two = tmp_one +def gcd(n, m): +    if n < m: +        temp = n +        n = m +        m = temp + +    def ecd(n, m): +        if n % m == 0: +            return m -            tmp_two = tmp_two % tmp_one -        if tmp_one % tmp_two == 0: -            tmp_one = tmp_two -        else: -            tmp_one = tmp_one % tmp_two -        if tmp_one == tmp_two: -            flg = 0 -    return tmp_one +            temp = n % m +            a = ecd(m, temp) +        return a + +    return ecd(n, m) -tmp_one = As[0] -for i in range(1, N): -    if i == N - 1: -        tmp_two = As[i] -    elif As[i] != As[0]: -        tmp_two = As[i] -        break -ans = judge(tmp_one, tmp_two) -print(ans) +temp = gcd(A[0], A[1]) +for i in range(0, N - 1): +    temp = gcd(temp, A[i]) +print(temp)