N = int(eval(input()))

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

A = sorted(A,reverse = False) 



B = [A[0]]

for i in range(N):

    if A[i]%A[0] != 0:

        B.append(A[i]%A[0])

B = set(B)

#B = sorted(B,reverse = False) 



#import math

import fractions

from functools import reduce



def gcd_list(numbers):

    #return reduce(math.gcd, numbers)

    return reduce(fractions.gcd, numbers)



print((gcd_list(B)))
N = int(eval(input()))

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



import fractions

from functools import reduce



def gcd_list(numbers):

    #return reduce(math.gcd, numbers)

    return reduce(fractions.gcd, numbers)



print((gcd_list(A)))
N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A, reverse=False)
B = [A[0]]
for i in range(N):
    if A[i] % A[0] != 0:
        B.append(A[i] % A[0])
B = set(B)
# B = sorted(B,reverse = False)
# import math
import fractions
from functools import reduce


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


print((gcd_list(B)))

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


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


print((gcd_list(A)))

-A = sorted(A, reverse=False) -B = [A[0]] -for i in range(N): -    if A[i] % A[0] != 0: -        B.append(A[i] % A[0]) -B = set(B) -# B = sorted(B,reverse = False) -# import math -print((gcd_list(B))) +print((gcd_list(A)))