import numpy as np
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    print(np.gcd.reduce(a))
main() import numpy as np numpy def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    print(np.gcd.reduce(a)) main n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] print(np.gcd.reduce(a)) print np.gcd.reduce(a) np.gcd.reduce np.gcd np gcd reduce a main() main def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    print(np.gcd.reduce(a)) def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    print(np.gcd.reduce(a)) main
import numpy as np
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    print(np.gcd.reduce(a))
main()