#! -*- coding: utf -*-

import fractions

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

for i in range(n-1):
    monsters[i + 1] = fractions.gcd(monsters[i], monsters[i + 1])

print(monsters[-1]) import fractions fractions n = int(input()) n int(input()) int input() input monsters = list(map(int, input().split())) monsters list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(n-1):
    monsters[i + 1] = fractions.gcd(monsters[i], monsters[i + 1]) i range(n-1) range n-1 n 1 monsters[i + 1] = fractions.gcd(monsters[i], monsters[i + 1]) monsters[i + 1] monsters i + 1 i 1 fractions.gcd(monsters[i], monsters[i + 1]) fractions.gcd fractions gcd monsters[i] monsters i monsters[i + 1] monsters i + 1 i 1 print(monsters[-1]) print monsters[-1] monsters -1 n = int(input()) int(input()) n monsters = list(map(int, input().split())) list(map(int, input().split())) monsters
#! -*- coding: utf -*-

import fractions

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

for i in range(n-1):
    monsters[i + 1] = fractions.gcd(monsters[i], monsters[i + 1])

print(monsters[-1])
