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

mn = min(A)
while True:
    ok = False
    for a in A:
        x = a % mn
        if x != 0 and x < mn:
            mn = x
            ok = True
    if not ok:
        break
print(mn) 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 mn = min(A) mn min(A) min A while True:
    ok = False
    for a in A:
        x = a % mn
        if x != 0 and x < mn:
            mn = x
            ok = True
    if not ok:
        break True ok = False ok False for a in A:
        x = a % mn
        if x != 0 and x < mn:
            mn = x
            ok = True
     a A x = a % mn x a % mn a mn if x != 0 and x < mn:
            mn = x
            ok = True
     x != 0 and x < mn x != 0 x 0 x < mn x mn mn = x mn x ok = True ok True if not ok:
        break not ok ok break print(mn) print mn A = list(map(int, input().split())) list(map(int, input().split())) A ok = False False ok N = int(input()) int(input()) N ok = True True ok mn = x x mn mn = min(A) min(A) mn x = a % mn a % mn x
N = int(input())
A = list(map(int, input().split()))

mn = min(A)
while True:
    ok = False
    for a in A:
        x = a % mn
        if x != 0 and x < mn:
            mn = x
            ok = True
    if not ok:
        break
print(mn)