n = int(eval(input()))



#モンスターiの体力:mon[i]

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





zero = 0

while mon.count(0) != (n-1):

    mon.sort()

    min = mon[zero]

    tei = zero + 1

    for i in range(tei,n):

        mon[i] = mon[i] % min

        if mon[i] == 0:

            zero += 1

mon.sort()

print((mon[zero]))

#モンスター数

n = int(eval(input()))



#モンスターiの体力:mon[i]

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



def gcd(a, b):

    if b == 0:

        return a

    else:

        return gcd(b, a%b)



ans = mon[0]

for i in range(1,n):

    ans = gcd(ans,mon[i])



print(ans)
n = int(eval(input()))
# モンスターiの体力:mon[i]
mon = list(map(int, input().split()))
zero = 0
while mon.count(0) != (n - 1):
    mon.sort()
    min = mon[zero]
    tei = zero + 1
    for i in range(tei, n):
        mon[i] = mon[i] % min
        if mon[i] == 0:
            zero += 1
mon.sort()
print((mon[zero]))

# モンスター数
n = int(eval(input()))
# モンスターiの体力:mon[i]
mon = list(map(int, input().split()))


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


ans = mon[0]
for i in range(1, n):
    ans = gcd(ans, mon[i])
print(ans)

+# モンスター数 -zero = 0 -while mon.count(0) != (n - 1): -    mon.sort() -    min = mon[zero] -    tei = zero + 1 -    for i in range(tei, n): -        mon[i] = mon[i] % min -        if mon[i] == 0: -            zero += 1 -mon.sort() -print((mon[zero])) + + +def gcd(a, b): +    if b == 0: +        return a +    else: +        return gcd(b, a % b) + + +ans = mon[0] +for i in range(1, n): +    ans = gcd(ans, mon[i]) +print(ans)