N = int(eval(input()))

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



def gcd(a,b):

    if b == 0:

        return a

    else:

        return gcd(b,a%b)

      

from functools import reduce

def lcm_base(x, y):

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



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)

  

print((lcm_list(T)))
N = int(eval(input()))

T = []

for i in range(N):

    T.append(int(eval(input())))

    

def gcd(a,b):

    if b == 0:

        return a

    else:

        return gcd(b,a%b)

      

from functools import reduce

def lcm_base(x, y):

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



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)

  

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


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


from functools import reduce


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


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print((lcm_list(T)))

N = int(eval(input()))
T = []
for i in range(N):
    T.append(int(eval(input())))


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


from functools import reduce


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


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


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print((lcm_list(T)))

-T = [int(eval(input())) for _ in range(N)] +T = [] +for i in range(N): +    T.append(int(eval(input())))