from math import gcd

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


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

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


for i in range(n-1):
  a[i+1] = gcd(a[i], a[i+1])
  
print(a[n-1])