import fractions

from functools import reduce

def gcd_list(l):

    return reduce(fractions.gcd, l)

n = int(eval(input()))

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

print((gcd_list(A)))
from functools import reduce

import math

def main():

    n = int(eval(input()))

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

    print((reduce(math.gcd, A)))



if __name__ == '__main__':

    main()

import fractions
from functools import reduce


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


n = int(eval(input()))
A = list(map(int, input().split()))
print((gcd_list(A)))

from functools import reduce
import math


def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    print((reduce(math.gcd, A)))


if __name__ == "__main__":
    main()

-import fractions +import math -def gcd_list(l): -    return reduce(fractions.gcd, l) +def main(): +    n = int(eval(input())) +    A = list(map(int, input().split())) +    print((reduce(math.gcd, A))) -n = int(eval(input())) -A = list(map(int, input().split())) -print((gcd_list(A))) +if __name__ == "__main__": +    main()