# 求最大公因數
def gcd(a, b):
if a % b == 0:
return b
else:
return gcd(b, a % b)
# 使用迴圈讀入多組資料
while True:
try:
n = int(input())
g = int(input())
for i in range(1, n):
a = int(input())
# 求最大公因數
g = gcd(g, a)
print(g)
except EOFError:
break