from fractions import*;eval(input());a,*b=list(map(int,input().split()))

for i in b:a=gcd(a,i)

print(a)
import math

eval(input())

a,*b=list(map(int,input().split()))

for i in b:a=math.gcd(a,i)

print(a)
from fractions import *

eval(input())
a, *b = list(map(int, input().split()))
for i in b:
    a = gcd(a, i)
print(a)

import math

eval(input())
a, *b = list(map(int, input().split()))
for i in b:
    a = math.gcd(a, i)
print(a)

-from fractions import * +import math -    a = gcd(a, i) +    a = math.gcd(a, i)