#!/usr/bin/env python3

#import
#import math
#import numpy as np
N = int(input())
A = list(map(int, input().split()))

def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)

a = gcd(A[0], A[1])

for i in range(2, N):
    a = gcd(a, A[i])

print(a) 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 def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y) gcd if x < y:
        t = x
        x = y
        y = t

     x < y x y t = x t x x = y x y y = t y t if y == 0:
        return x

    else:
        return gcd(y, x % y) y == 0 y 0 return x x return gcd(y, x % y) gcd(y, x % y) gcd y x % y x y x x y y a = gcd(A[0], A[1]) a gcd(A[0], A[1]) gcd A[0] A 0 A[1] A 1 for i in range(2, N):
    a = gcd(a, A[i]) i range(2, N) range 2 N a = gcd(a, A[i]) a gcd(a, A[i]) gcd a A[i] A i print(a) print a a = gcd(A[0], A[1]) gcd(A[0], A[1]) a A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N a = gcd(a, A[i]) gcd(a, A[i]) a def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y) def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y) gcd
#!/usr/bin/env python3

#import
#import math
#import numpy as np
N = int(input())
A = list(map(int, input().split()))

def gcd(x, y):
    if x < y:
        t = x
        x = y
        y = t

    if y == 0:
        return x

    else:
        return gcd(y, x % y)

a = gcd(A[0], A[1])

for i in range(2, N):
    a = gcd(a, A[i])

print(a)
