require 'prime'

N = gets.to_i
As = gets.split.map(&:to_i)

pMap = {}

As.each{|val| Prime.prime_division(val).each{|p, n|
	pMap[p] = if pMap[p] == nil then
		[1, n]
	else
		occur, m = pMap[p]
		[occur + 1, m < n ? m : n]
	end
}}

ans = 1
for (k, v) in pMap do
	ans *= k**v[1] if v[0] + 1 >= N
end

p ans
