from math import gcd
N = int(input())
A = list(map(int, input().split()))

while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
print(A[0]) 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 while len(A) > 1:
    A.append(gcd(A.pop(), A.pop())) len(A) > 1 len(A) len A 1 A.append(gcd(A.pop(), A.pop())) A.append A append gcd(A.pop(), A.pop()) gcd A.pop() A.pop A pop A.pop() A.pop A pop print(A[0]) print A[0] A 0 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()))

while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
print(A[0])
