import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()])
d = a.min()
while True:
    a1 = a % d
    if all(a1 == 0):
        ans = d
        break
    d = min(a1[a1 != 0])    
print(ans) import numpy as np numpy n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = np.array([int(i) for i in input().split()]) a np.array([int(i) for i in input().split()]) np.array np array [int(i) for i in input().split()] d = a.min() d a.min() a.min a min while True:
    a1 = a % d
    if all(a1 == 0):
        ans = d
        break
    d = min(a1[a1 != 0])     True a1 = a % d a1 a % d a d if all(a1 == 0):
        ans = d
        break
     all(a1 == 0) all a1 == 0 a1 0 ans = d ans d break d = min(a1[a1 != 0]) d min(a1[a1 != 0]) min a1[a1 != 0] a1 a1 != 0 a1 0 print(ans) print ans a1 = a % d a % d a1 a = np.array([int(i) for i in input().split()]) np.array([int(i) for i in input().split()]) a ans = d d ans d = min(a1[a1 != 0]) min(a1[a1 != 0]) d n = int(input()) int(input()) n d = a.min() a.min() d
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()])
d = a.min()
while True:
    a1 = a % d
    if all(a1 == 0):
        ans = d
        break
    d = min(a1[a1 != 0])    
print(ans)