def gcd(a, b): while(a and b): if(a > b): a %= b else: b %= a return a + b K = int(input()) prev = int(input()) for i in range(K - 1): current = int(input()) prev = gcd(prev, current) print(prev)