n = int(eval(input()))

A = list(map(int, input().split()))



import fractions

#import math

from functools import reduce



def gcd(*numbers):

    return reduce(fractions.gcd, numbers)

    #return reduce(math.gcd, numbers)



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)

    #return reduce(math.gcd, numbers)



g = gcd_list(A)

print(g)

n = int(eval(input()))

A = list(map(int, input().split()))



#import fractions

import math

from functools import reduce



def gcd(*numbers):

    #return reduce(fractions.gcd, numbers)

    return reduce(math.gcd, numbers)



def gcd_list(numbers):

    #return reduce(fractions.gcd, numbers)

    return reduce(math.gcd, numbers)



print((gcd_list(A)))

n = int(eval(input()))
A = list(map(int, input().split()))
import fractions

# import math
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
    # return reduce(math.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
    # return reduce(math.gcd, numbers)


g = gcd_list(A)
print(g)

n = int(eval(input()))
A = list(map(int, input().split()))
# import fractions
import math
from functools import reduce


def gcd(*numbers):
    # return reduce(fractions.gcd, numbers)
    return reduce(math.gcd, numbers)


def gcd_list(numbers):
    # return reduce(fractions.gcd, numbers)
    return reduce(math.gcd, numbers)


print((gcd_list(A)))

-import fractions - -# import math +# import fractions +import math -    return reduce(fractions.gcd, numbers) -    # return reduce(math.gcd, numbers) +    # return reduce(fractions.gcd, numbers) +    return reduce(math.gcd, numbers) -    return reduce(fractions.gcd, numbers) -    # return reduce(math.gcd, numbers) +    # return reduce(fractions.gcd, numbers) +    return reduce(math.gcd, numbers) -g = gcd_list(A) -print(g) +print((gcd_list(A)))