from fractions import gcd



N = eval(input())

ans = 0

for a in map(int, input().split()):

    ans = gcd(ans, a)

print(ans)

import fractions, functools

N = eval(input())

print((functools.reduce(fractions.gcd, list(map(int, input().split())))))

from fractions import gcd

N = eval(input())
ans = 0
for a in map(int, input().split()):
    ans = gcd(ans, a)
print(ans)

import fractions, functools

N = eval(input())
print((functools.reduce(fractions.gcd, list(map(int, input().split())))))

-from fractions import gcd +import fractions, functools -ans = 0 -for a in map(int, input().split()): -    ans = gcd(ans, a) -print(ans) +print((functools.reduce(fractions.gcd, list(map(int, input().split())))))