from fractions import gcd
n = int(input())
a = [int(i) for i in input().split()]
g = a[0]
for i in a[1:]:
    g = gcd(g, i)
    if g == 1:
        break
print(g) from fractions import gcd 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 = [int(i) for i in input().split()] a [int(i) for i in input().split()] g = a[0] g a[0] a 0 for i in a[1:]:
    g = gcd(g, i)
    if g == 1:
        break i a[1:] a 1: 1 g = gcd(g, i) g gcd(g, i) gcd g i if g == 1:
        break g == 1 g 1 break print(g) print g g = a[0] a[0] g g = gcd(g, i) gcd(g, i) g a = [int(i) for i in input().split()] [int(i) for i in input().split()] a n = int(input()) int(input()) n
from fractions import gcd
n = int(input())
a = [int(i) for i in input().split()]
g = a[0]
for i in a[1:]:
    g = gcd(g, i)
    if g == 1:
        break
print(g)