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

while True:
    A_org = A[0:]
    min_A = max(A)
    min_index = A.index(min_A)
    for i in range(N):
        if A[i] < min_A and A[i] >= 1:
            min_A = A[i]
            min_index = i
    for i in range(N):
        if i == min_index:
            pass
        else:
            A[i] %= min_A
    if A == A_org:
        break

print(max(A)) 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 while True:
    A_org = A[0:]
    min_A = max(A)
    min_index = A.index(min_A)
    for i in range(N):
        if A[i] < min_A and A[i] >= 1:
            min_A = A[i]
            min_index = i
    for i in range(N):
        if i == min_index:
            pass
        else:
            A[i] %= min_A
    if A == A_org:
        break True A_org = A[0:] A_org A[0:] A 0: 0 min_A = max(A) min_A max(A) max A min_index = A.index(min_A) min_index A.index(min_A) A.index A index min_A for i in range(N):
        if A[i] < min_A and A[i] >= 1:
            min_A = A[i]
            min_index = i
     i range(N) range N if A[i] < min_A and A[i] >= 1:
            min_A = A[i]
            min_index = i
     A[i] < min_A and A[i] >= 1 A[i] < min_A A[i] A i min_A A[i] >= 1 A[i] A i 1 min_A = A[i] min_A A[i] A i min_index = i min_index i for i in range(N):
        if i == min_index:
            pass
        else:
            A[i] %= min_A
     i range(N) range N if i == min_index:
            pass
        else:
            A[i] %= min_A
     i == min_index i min_index A[i] %= min_A A[i] A i min_A if A == A_org:
        break A == A_org A A_org break print(max(A)) print max(A) max A min_A = A[i] A[i] min_A N = int(input()) int(input()) N A_org = A[0:] A[0:] A_org min_index = i i min_index min_index = A.index(min_A) A.index(min_A) min_index A = list(map(int, input().split())) list(map(int, input().split())) A min_A = max(A) max(A) min_A
N = int(input())
A = list(map(int, input().split()))

while True:
    A_org = A[0:]
    min_A = max(A)
    min_index = A.index(min_A)
    for i in range(N):
        if A[i] < min_A and A[i] >= 1:
            min_A = A[i]
            min_index = i
    for i in range(N):
        if i == min_index:
            pass
        else:
            A[i] %= min_A
    if A == A_org:
        break

print(max(A))