def solve(a, b):
    mod = 1
    while mod != 0:
        mod = b%a
        b = a
        a = mod
    return b

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

minA = min(A)
B = [a%minA for a in A]
print(solve(minA, max(B))) def solve(a, b):
    mod = 1
    while mod != 0:
        mod = b%a
        b = a
        a = mod
    return b solve mod = 1 mod 1 while mod != 0:
        mod = b%a
        b = a
        a = mod
     mod != 0 mod 0 mod = b%a mod b%a b a b = a b a a = mod a mod return b b a a b b N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split minA = min(A) minA min(A) min A a%minA for a in A for a in A a A for a in A a%minA a minA B = [a%minA for a in A] B [a%minA for a in A] print(solve(minA, max(B))) print solve(minA, max(B)) solve minA max(B) max B B = [a%minA for a in A] [a%minA for a in A] B minA = min(A) min(A) minA def solve(a, b):
    mod = 1
    while mod != 0:
        mod = b%a
        b = a
        a = mod
    return b def solve(a, b):
    mod = 1
    while mod != 0:
        mod = b%a
        b = a
        a = mod
    return b solve N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A
def solve(a, b):
    mod = 1
    while mod != 0:
        mod = b%a
        b = a
        a = mod
    return b

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

minA = min(A)
B = [a%minA for a in A]
print(solve(minA, max(B)))