n = eval(input())

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

nums = sorted(nums)

i=n-2

x=1

while True:

    if i<0:

        break

    tmp =nums[n-1]*x 

    if tmp%nums[i]==0:

        i-=1

    else:

        x+=1

        i=n-2

print(tmp)
n = eval(input())

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

x = 2

checklist = [0 for i in range(n)]

table = []

while x<=max(nums):

    i=0

    while i<n:

        if nums[i]%x==0:

            checklist[i]=0

            nums[i] = nums[i]/x

        else:

            checklist[i]=1

        i+=1

    if 0 in checklist:

        table.append(x)

    else:

        x+=1

ans = 1

# print nums

# print table

if len(table)==0:

    for num in nums:

        ans *= num

else:

    for num in nums:

        ans *= num

    for y in table:

        ans *= y

print(ans)
n = eval(input())
nums = list(map(int, input().split()))
nums = sorted(nums)
i = n - 2
x = 1
while True:
    if i < 0:
        break
    tmp = nums[n - 1] * x
    if tmp % nums[i] == 0:
        i -= 1
    else:
        x += 1
        i = n - 2
print(tmp)

n = eval(input())
nums = list(map(int, input().split()))
x = 2
checklist = [0 for i in range(n)]
table = []
while x <= max(nums):
    i = 0
    while i < n:
        if nums[i] % x == 0:
            checklist[i] = 0
            nums[i] = nums[i] / x
        else:
            checklist[i] = 1
        i += 1
    if 0 in checklist:
        table.append(x)
    else:
        x += 1
ans = 1
# print nums
# print table
if len(table) == 0:
    for num in nums:
        ans *= num
else:
    for num in nums:
        ans *= num
    for y in table:
        ans *= y
print(ans)

-nums = sorted(nums) -i = n - 2 -x = 1 -while True: -    if i < 0: -        break -    tmp = nums[n - 1] * x -    if tmp % nums[i] == 0: -        i -= 1 +x = 2 +checklist = [0 for i in range(n)] +table = [] +while x <= max(nums): +    i = 0 +    while i < n: +        if nums[i] % x == 0: +            checklist[i] = 0 +            nums[i] = nums[i] / x +        else: +            checklist[i] = 1 +        i += 1 +    if 0 in checklist: +        table.append(x) -        i = n - 2 -print(tmp) +ans = 1 +# print nums +# print table +if len(table) == 0: +    for num in nums: +        ans *= num +else: +    for num in nums: +        ans *= num +    for y in table: +        ans *= y +print(ans)