from fractions import gcd

from functools import reduce

n = int(eval(input()))

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

print((reduce(gcd,li)))
n = int(eval(input()))

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



def gcd(x,y):

    if y > x:

        x,y = y,x

    if x%y == 0:

        return y

    else:

        return gcd(y,x%y)

        

from functools import reduce

ans = reduce(gcd,L)

print(ans)
from fractions import gcd
from functools import reduce

n = int(eval(input()))
li = list(map(int, input().split()))
print((reduce(gcd, li)))

n = int(eval(input()))
L = list(map(int, input().split()))


def gcd(x, y):
    if y > x:
        x, y = y, x
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)


from functools import reduce

ans = reduce(gcd, L)
print(ans)

-from fractions import gcd +n = int(eval(input())) +L = list(map(int, input().split())) + + +def gcd(x, y): +    if y > x: +        x, y = y, x +    if x % y == 0: +        return y +    else: +        return gcd(y, x % y) + + -n = int(eval(input())) -li = list(map(int, input().split())) -print((reduce(gcd, li))) +ans = reduce(gcd, L) +print(ans)