import fractions

N = int(input())
a, *A = map(int, input().split())

for x in A:
    a = fractions.gcd(x, a)

print(a) import fractions fractions N = int(input()) N int(input()) int input() input a, *A = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split *A A for x in A:
    a = fractions.gcd(x, a) x A a = fractions.gcd(x, a) a fractions.gcd(x, a) fractions.gcd fractions gcd x a print(a) print a a = fractions.gcd(x, a) fractions.gcd(x, a) a N = int(input()) int(input()) N a, *A = map(int, input().split()) map(int, input().split()) a
import fractions

N = int(input())
a, *A = map(int, input().split())

for x in A:
    a = fractions.gcd(x, a)

print(a)