N = int(eval(input()))

ans = int(eval(input()))

import fractions

for i in range(N-1):

  a = int(eval(input()))

  ans = (a*ans)//fractions.gcd(ans, a)

print(ans)
N = int(eval(input()))

import math

ans = int(eval(input()))

for i in range(N - 1):

    a = int(eval(input()))

    ans = a * ans // math.gcd(a, ans)

print(ans)
N = int(eval(input()))
ans = int(eval(input()))
import fractions

for i in range(N - 1):
    a = int(eval(input()))
    ans = (a * ans) // fractions.gcd(ans, a)
print(ans)

N = int(eval(input()))
import math

ans = int(eval(input()))
for i in range(N - 1):
    a = int(eval(input()))
    ans = a * ans // math.gcd(a, ans)
print(ans)

+import math + -import fractions - -    ans = (a * ans) // fractions.gcd(ans, a) +    ans = a * ans // math.gcd(a, ans)