import numpy as np





def gcd(a,b):

    while b:

        a,b = b,a%b

    return a



def lcm_base(x, y):

    return x*y // gcd(x, y)



N = int(eval(input()))

T = [int(eval(input())) for _ in range(N)]



ans = 1

for t in T:

    ans = lcm_base(ans,t)

print(ans)

N = int(eval(input()))

T = [int(eval(input())) for _ in range(N)]



def gcd(a,b):#gcd :: greatest common divisor(最大公約数) :: G

    if b == 0:

        return a

    else:

        return gcd(b, a%b)

def lcm(X,Y):#lcm :: least common multiple(最小公約数)) :: L

    return X*Y // gcd(X,Y) # XY = GL



ans = 1



for t in T:

    ans = lcm(ans, t)

print(ans)

import numpy as np


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm_base(x, y):
    return x * y // gcd(x, y)


N = int(eval(input()))
T = [int(eval(input())) for _ in range(N)]
ans = 1
for t in T:
    ans = lcm_base(ans, t)
print(ans)

N = int(eval(input()))
T = [int(eval(input())) for _ in range(N)]


def gcd(a, b):  # gcd :: greatest common divisor(最大公約数) :: G
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(X, Y):  # lcm :: least common multiple(最小公約数)) :: L
    return X * Y // gcd(X, Y)  # XY = GL


ans = 1
for t in T:
    ans = lcm(ans, t)
print(ans)

-import numpy as np +N = int(eval(input())) +T = [int(eval(input())) for _ in range(N)] -def gcd(a, b): -    while b: -        a, b = b, a % b -    return a +def gcd(a, b):  # gcd :: greatest common divisor(最大公約数) :: G +    if b == 0: +        return a +    else: +        return gcd(b, a % b) -def lcm_base(x, y): -    return x * y // gcd(x, y) +def lcm(X, Y):  # lcm :: least common multiple(最小公約数)) :: L +    return X * Y // gcd(X, Y)  # XY = GL -N = int(eval(input())) -T = [int(eval(input())) for _ in range(N)] -    ans = lcm_base(ans, t) +    ans = lcm(ans, t)