import sys
N = int(input())
A = list(map(int, input().split()))
a = min(A)
b = a
while True:
    for _a in A:
        _b = _a % a
        if _b > 0 and _b < a:
            b = _b
    if b == a:
        print(a)
        sys.exit()
    a = b import sys sys 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 a = min(A) a min(A) min A b = a b a while True:
    for _a in A:
        _b = _a % a
        if _b > 0 and _b < a:
            b = _b
    if b == a:
        print(a)
        sys.exit()
    a = b True for _a in A:
        _b = _a % a
        if _b > 0 and _b < a:
            b = _b
     _a A _b = _a % a _b _a % a _a a if _b > 0 and _b < a:
            b = _b
     _b > 0 and _b < a _b > 0 _b 0 _b < a _b a b = _b b _b if b == a:
        print(a)
        sys.exit()
     b == a b a print(a) print a sys.exit() sys.exit sys exit a = b a b A = list(map(int, input().split())) list(map(int, input().split())) A a = min(A) min(A) a _b = _a % a _a % a _b b = a a b N = int(input()) int(input()) N a = b b a b = _b _b b
import sys
N = int(input())
A = list(map(int, input().split()))
a = min(A)
b = a
while True:
    for _a in A:
        _b = _a % a
        if _b > 0 and _b < a:
            b = _b
    if b == a:
        print(a)
        sys.exit()
    a = b
