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

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

ans = a[0]
for x in a:
  ans = fractions.gcd(ans, x)
print(ans)