import fractions

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

last = a[0]

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

print(last) import fractions fractions n = int(input()) n int(input()) int input() input a = sorted(list(map(int, input().split())), reverse = True) a sorted(list(map(int, input().split())), reverse = True) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split reverse = True reverse True last = a[0] last a[0] a 0 for i in range(1, n):
    last = fractions.gcd(last, a[i]) i range(1, n) range 1 n last = fractions.gcd(last, a[i]) last fractions.gcd(last, a[i]) fractions.gcd fractions gcd last a[i] a i print(last) print last last = a[0] a[0] last n = int(input()) int(input()) n a = sorted(list(map(int, input().split())), reverse = True) sorted(list(map(int, input().split())), reverse = True) a last = fractions.gcd(last, a[i]) fractions.gcd(last, a[i]) last
import fractions

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

last = a[0]

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

print(last)