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