#gcdか....

def fgcd(a,b):

    while b:

        a,b = b,a%b

    return a



N = int(eval(input()))

aA = sorted(set(int(_) for _ in input().split()))

b = aA[0]

for a in aA[1:]:

    b = fgcd(a,b)

print(b)

N = int(eval(input()))

aA=[int(_) for _ in input().split()]

iMin = min(aA)

iMax = max(aA)



def fgcd(a,b):

    while b:

        a,b = b,a%b

    return a



if iMin  == 1:

    print((1))

else:

    iDm = [ _ % iMin for _ in aA]

    if max(iDm) == 0:

        print(iMin)

    else:

        b = aA[0]

        for _ in aA[1:]:

            b = fgcd(_,b)

            if b == 1:

                print((1))

                exit()

        print(b)

# gcdか....
def fgcd(a, b):
    while b:
        a, b = b, a % b
    return a


N = int(eval(input()))
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a, b)
print(b)

N = int(eval(input()))
aA = [int(_) for _ in input().split()]
iMin = min(aA)
iMax = max(aA)


def fgcd(a, b):
    while b:
        a, b = b, a % b
    return a


if iMin == 1:
    print((1))
else:
    iDm = [_ % iMin for _ in aA]
    if max(iDm) == 0:
        print(iMin)
    else:
        b = aA[0]
        for _ in aA[1:]:
            b = fgcd(_, b)
            if b == 1:
                print((1))
                exit()
        print(b)

-# gcdか.... +N = int(eval(input())) +aA = [int(_) for _ in input().split()] +iMin = min(aA) +iMax = max(aA) + + -N = int(eval(input())) -aA = sorted(set(int(_) for _ in input().split())) -b = aA[0] -for a in aA[1:]: -    b = fgcd(a, b) -print(b) +if iMin == 1: +    print((1)) +else: +    iDm = [_ % iMin for _ in aA] +    if max(iDm) == 0: +        print(iMin) +    else: +        b = aA[0] +        for _ in aA[1:]: +            b = fgcd(_, b) +            if b == 1: +                print((1)) +                exit() +        print(b)