import sys

input = sys.stdin.readline

from collections import *

from fractions import *



N = int(eval(input()))

A = list(map(int, input().split()))

G = 0



for Ai in A:

    G = gcd(G, Ai)



print(G)
import sys

input = sys.stdin.readline

from math import gcd



N = int(eval(input()))

A = list(map(int, input().split()))

G = 0



for Ai in A:

    G = gcd(G, Ai)



print(G)
import sys

input = sys.stdin.readline
from collections import *
from fractions import *

N = int(eval(input()))
A = list(map(int, input().split()))
G = 0
for Ai in A:
    G = gcd(G, Ai)
print(G)

import sys

input = sys.stdin.readline
from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
G = 0
for Ai in A:
    G = gcd(G, Ai)
print(G)

-from collections import * -from fractions import * +from math import gcd