N = int(input())
A = list(map(int,input().split()))
A_list = [float('inf')] * N

ans = min(A)
while max(A_list) > 0:
    mi = ans
    for i,a in enumerate(A):
        amari = a % mi
        A_list[i] = amari
        if amari != 0:
            ans = min(ans,amari)

print(ans) 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_list = [float('inf')] * N A_list [float('inf')] * N [float('inf')] float('inf') float 'inf' N ans = min(A) ans min(A) min A while max(A_list) > 0:
    mi = ans
    for i,a in enumerate(A):
        amari = a % mi
        A_list[i] = amari
        if amari != 0:
            ans = min(ans,amari) max(A_list) > 0 max(A_list) max A_list 0 mi = ans mi ans for i,a in enumerate(A):
        amari = a % mi
        A_list[i] = amari
        if amari != 0:
            ans = min(ans,amari) i a enumerate(A) enumerate A amari = a % mi amari a % mi a mi A_list[i] = amari A_list[i] A_list i amari if amari != 0:
            ans = min(ans,amari) amari != 0 amari 0 ans = min(ans,amari) ans min(ans,amari) min ans amari print(ans) print ans A = list(map(int,input().split())) list(map(int,input().split())) A mi = ans ans mi ans = min(A) min(A) ans ans = min(ans,amari) min(ans,amari) ans A_list = [float('inf')] * N [float('inf')] * N A_list N = int(input()) int(input()) N amari = a % mi a % mi amari
N = int(input())
A = list(map(int,input().split()))
A_list = [float('inf')] * N

ans = min(A)
while max(A_list) > 0:
    mi = ans
    for i,a in enumerate(A):
        amari = a % mi
        A_list[i] = amari
        if amari != 0:
            ans = min(ans,amari)

print(ans)