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



tmp = judge(tmp_one, tmp_two)

print(tmp)

import fractions





N = int(eval(input()))

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



 

ans = fractions.gcd(A[0], A[1])



for i in range(2, N):

    ans = fractions.gcd(ans, A[i])



print(ans)

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
tmp = judge(tmp_one, tmp_two)
print(tmp)

import fractions

N = int(eval(input()))
A = list(map(int, input().split()))
ans = fractions.gcd(A[0], A[1])
for i in range(2, N):
    ans = fractions.gcd(ans, A[i])
print(ans)

+import fractions + -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 -tmp = judge(tmp_one, tmp_two) -print(tmp) +ans = fractions.gcd(A[0], A[1]) +for i in range(2, N): +    ans = fractions.gcd(ans, A[i]) +print(ans)