n=int(input())
a=sorted(set([int(x) for x in input().split()]))

while len(a)!=1:
    if a[0]==0:
        a=a[1:]
    for i in range(1,len(a)):
        a[i]%=a[0]
    a=sorted(set(a))

print(a[0]) n=int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a=sorted(set([int(x) for x in input().split()])) a sorted(set([int(x) for x in input().split()])) sorted set([int(x) for x in input().split()]) set [int(x) for x in input().split()] while len(a)!=1:
    if a[0]==0:
        a=a[1:]
    for i in range(1,len(a)):
        a[i]%=a[0]
    a=sorted(set(a)) len(a)!=1 len(a) len a 1 if a[0]==0:
        a=a[1:]
     a[0]==0 a[0] a 0 0 a=a[1:] a a[1:] a 1: 1 for i in range(1,len(a)):
        a[i]%=a[0]
     i range(1,len(a)) range 1 len(a) len a a[i]%=a[0] a[i] a i a[0] a 0 a=sorted(set(a)) a sorted(set(a)) sorted set(a) set a print(a[0]) print a[0] a 0 a=sorted(set([int(x) for x in input().split()])) sorted(set([int(x) for x in input().split()])) a a=sorted(set(a)) sorted(set(a)) a n=int(input()) int(input()) n a=a[1:] a[1:] a
n=int(input())
a=sorted(set([int(x) for x in input().split()]))

while len(a)!=1:
    if a[0]==0:
        a=a[1:]
    for i in range(1,len(a)):
        a[i]%=a[0]
    a=sorted(set(a))

print(a[0])
