import fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline


def main():
    n = int(input())
    a = input_list()
    print(gcd_list(a))

def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main() import fractions fractions import sys sys from functools import reduce import math math input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    n = int(input())
    a = input_list()
    print(gcd_list(a)) main n = int(input()) n int(input()) int input() input a = input_list() a input_list() input_list print(gcd_list(a)) print gcd_list(a) gcd_list a def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l)) get_camulative import itertools itertools return [0] + list(itertools.accumulate(l)) [0] + list(itertools.accumulate(l)) [0] 0 list(itertools.accumulate(l)) list itertools.accumulate(l) itertools.accumulate itertools accumulate l l l def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) combinations_count return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) math.factorial(n) math.factorial math factorial n math.factorial(n - r) * math.factorial(r) math.factorial(n - r) math.factorial math factorial n - r n r math.factorial(r) math.factorial math factorial r n n r r def input_list():
    return list(map(int, input().split())) input_list return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def input_list_str():
    return list(map(str, input().split())) input_list_str return list(map(str, input().split())) list(map(str, input().split())) list map(str, input().split()) map str input().split() ().split () input split def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y) lcm_base return (x * y) // fractions.gcd(x, y) (x * y) // fractions.gcd(x, y) x * y x y fractions.gcd(x, y) fractions.gcd fractions gcd x y x x y y def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) lcm_list return reduce(lcm_base, numbers, 1) reduce(lcm_base, numbers, 1) reduce lcm_base numbers 1 numbers numbers def gcd(*numbers):
    return reduce(fractions.gcd, numbers) gcd return reduce(fractions.gcd, numbers) reduce(fractions.gcd, numbers) reduce fractions.gcd fractions gcd numbers *numbers def gcd_list(numbers):
    return reduce(fractions.gcd, numbers) gcd_list return reduce(fractions.gcd, numbers) reduce(fractions.gcd, numbers) reduce fractions.gcd fractions gcd numbers numbers numbers if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.readline sys.stdin.readline input def main():
    n = int(input())
    a = input_list()
    print(gcd_list(a)) def main():
    n = int(input())
    a = input_list()
    print(gcd_list(a)) main def gcd_list(numbers):
    return reduce(fractions.gcd, numbers) def gcd_list(numbers):
    return reduce(fractions.gcd, numbers) gcd_list def input_list():
    return list(map(int, input().split())) def input_list():
    return list(map(int, input().split())) input_list def gcd(*numbers):
    return reduce(fractions.gcd, numbers) def gcd(*numbers):
    return reduce(fractions.gcd, numbers) gcd def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) combinations_count def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y) def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y) lcm_base def input_list_str():
    return list(map(str, input().split())) def input_list_str():
    return list(map(str, input().split())) input_list_str def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1) lcm_list def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l)) def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l)) get_camulative
import fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline


def main():
    n = int(input())
    a = input_list()
    print(gcd_list(a))

def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main()
