from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

g=a[0]
for i in a[1:]:
    g = gcd(g,i)

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

n = int(input())
a = list(map(int, input().split()))

g=a[0]
for i in a[1:]:
    g = gcd(g,i)

print(g)