N  = int(eval(input()))



data = [int(i) for i in input().split()]



i = 0

def euq(x,y):

  a = max(x,y)

  b = min(x,y)

  if a % b == 0:

    return b

  else:

  	return euq(b, a % b)

  





while i < N-1:

  com =  euq(data[i],data[i + 1])

  data[i+1] = com

  i += 1

  

  



print(com)

n = int(eval(input()))

data = [int(s) for s in input().split()]



def gcd(a,b):

    if b == 0:

        return a

    else:

        return gcd(b,a%b)





x = gcd(data[0], data[1])

for i in range(2,n-1):

    x = gcd(x,data[i])

print(x)

N = int(eval(input()))
data = [int(i) for i in input().split()]
i = 0


def euq(x, y):
    a = max(x, y)
    b = min(x, y)
    if a % b == 0:
        return b
    else:
        return euq(b, a % b)


while i < N - 1:
    com = euq(data[i], data[i + 1])
    data[i + 1] = com
    i += 1
print(com)

n = int(eval(input()))
data = [int(s) for s in input().split()]


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


x = gcd(data[0], data[1])
for i in range(2, n - 1):
    x = gcd(x, data[i])
print(x)

-N = int(eval(input())) -data = [int(i) for i in input().split()] -i = 0 +n = int(eval(input())) +data = [int(s) for s in input().split()] -def euq(x, y): -    a = max(x, y) -    b = min(x, y) -    if a % b == 0: -        return b +def gcd(a, b): +    if b == 0: +        return a -        return euq(b, a % b) +        return gcd(b, a % b) -while i < N - 1: -    com = euq(data[i], data[i + 1]) -    data[i + 1] = com -    i += 1 -print(com) +x = gcd(data[0], data[1]) +for i in range(2, n - 1): +    x = gcd(x, data[i]) +print(x)