from functools import reduce
def gcd(a, b):

    if a < b: a, b = b, a

    while b:

        t = a / b

        a -= b * t

        a, b = b, a

    return a

def lcm(a, b):

    return a * b / gcd(a, b)

n = eval(input())

print(reduce(lambda a, b:lcm(a, b), list(map(int, input().split()))))
from functools import reduce
def gcd(a, b):

    if b == 0: return a

    else: return gcd(b, a % b)

def lcm(a, b):

    return a * b / gcd(a, b)

n = eval(input())

print(reduce(lambda a, b:lcm(a, b), list(map(int, input().split()))))
from functools import reduce


def gcd(a, b):
    if a < b:
        a, b = b, a
    while b:
        t = a / b
        a -= b * t
        a, b = b, a
    return a


def lcm(a, b):
    return a * b / gcd(a, b)


n = eval(input())
print(reduce(lambda a, b: lcm(a, b), list(map(int, input().split()))))

from functools import reduce


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


def lcm(a, b):
    return a * b / gcd(a, b)


n = eval(input())
print(reduce(lambda a, b: lcm(a, b), list(map(int, input().split()))))

-    if a < b: -        a, b = b, a -    while b: -        t = a / b -        a -= b * t -        a, b = b, a -    return a +    if b == 0: +        return a +    else: +        return gcd(b, a % b)