n=int(eval(input()))



# 最上公倍数を考える

from fractions import gcd

from functools import reduce



def lcm_base(x, y):

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



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



num_list=[]

for _ in range(n):

    num_list.append(int(eval(input())))

print((lcm(*num_list)))
n=int(eval(input()))



# 最上公倍数を考える

from fractions import gcd

from functools import reduce



def lcm_base(x, y):

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



def lcm(*numbers):

    return reduce(lcm_base, numbers)



num_list=[]

for _ in range(n):

    num_list.append(int(eval(input())))

print((lcm(*num_list)))
n = int(eval(input()))
# 最上公倍数を考える
from fractions import gcd
from functools import reduce


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


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


num_list = []
for _ in range(n):
    num_list.append(int(eval(input())))
print((lcm(*num_list)))

n = int(eval(input()))
# 最上公倍数を考える
from fractions import gcd
from functools import reduce


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


def lcm(*numbers):
    return reduce(lcm_base, numbers)


num_list = []
for _ in range(n):
    num_list.append(int(eval(input())))
print((lcm(*num_list)))

-    return reduce(lcm_base, numbers, 1) +    return reduce(lcm_base, numbers)