#!/usr/bin/env python3

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


value = a[0]
for i in range(1, n):
    value = fractions.gcd(value, a[i])
print(value)
 import fractions fractions 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 value = a[0] value a[0] a 0 for i in range(1, n):
    value = fractions.gcd(value, a[i]) i range(1, n) range 1 n value = fractions.gcd(value, a[i]) value fractions.gcd(value, a[i]) fractions.gcd fractions gcd value a[i] a i print(value) print value a = list(map(int, input().split())) list(map(int, input().split())) a value = fractions.gcd(value, a[i]) fractions.gcd(value, a[i]) value value = a[0] a[0] value n = int(input()) int(input()) n
#!/usr/bin/env python3

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


value = a[0]
for i in range(1, n):
    value = fractions.gcd(value, a[i])
print(value)

