#!/usr/bin/env python3

# from numba import njit
from math import gcd
from functools import reduce
# input = stdin.readline

# @njit
def solve(n,a):
  ans = reduce(gcd,a)
  return ans



def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return

if __name__ == '__main__':
  main() from math import gcd from functools import reduce def solve(n,a):
  ans = reduce(gcd,a)
  return ans solve ans = reduce(gcd,a) ans reduce(gcd,a) reduce gcd a return ans ans n n a a def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return main 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 print(solve(N,a)) print solve(N,a) solve N a return if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return main def solve(n,a):
  ans = reduce(gcd,a)
  return ans def solve(n,a):
  ans = reduce(gcd,a)
  return ans solve
#!/usr/bin/env python3

# from numba import njit
from math import gcd
from functools import reduce
# input = stdin.readline

# @njit
def solve(n,a):
  ans = reduce(gcd,a)
  return ans



def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()
