N = int(input())
A = set(map(int,input().split()))
def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans

while len(A)>1:
    A = helper(A)
print(min(A)) N = int(input()) N int(input()) int input() input A = set(map(int,input().split())) A set(map(int,input().split())) set map(int,input().split()) map int input().split() ().split () input split def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans helper v = min(A) v min(A) min A ans = set() ans set() set for a in A:
        if a%v!=0:
            ans.add(a%v)
     a A if a%v!=0:
            ans.add(a%v)
     a%v!=0 a%v a v 0 ans.add(a%v) ans.add ans add a%v a v ans.add(v) ans.add ans add v return ans ans A A while len(A)>1:
    A = helper(A) len(A)>1 len(A) len A 1 A = helper(A) A helper(A) helper A print(min(A)) print min(A) min A A = set(map(int,input().split())) set(map(int,input().split())) A A = helper(A) helper(A) A N = int(input()) int(input()) N def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans helper
N = int(input())
A = set(map(int,input().split()))
def helper(A):
    v = min(A)
    ans = set()
    for a in A:
        if a%v!=0:
            ans.add(a%v)
    ans.add(v)
    return ans

while len(A)>1:
    A = helper(A)
print(min(A))