import sys
input = sys.stdin.readline
from math import gcd

N = int(input())
A = list(map(int, input().split()))
G = 0

for Ai in A:
    G = gcd(G, Ai)

print(G) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 G = 0 G 0 for Ai in A:
    G = gcd(G, Ai) Ai A G = gcd(G, Ai) G gcd(G, Ai) gcd G Ai print(G) print G G = gcd(G, Ai) gcd(G, Ai) G N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A input = sys.stdin.readline sys.stdin.readline input G = 0 0 G
import sys
input = sys.stdin.readline
from math import gcd

N = int(input())
A = list(map(int, input().split()))
G = 0

for Ai in A:
    G = gcd(G, Ai)

print(G)