require'prime'
n=gets.to_i
A=gets.split.map &:to_i
B=[1]*n
r=A.reduce:gcd
A.map!{|a|a/r}
M=A.max
Prime.each{|p|
	break if p>M
	f=true
	while f
		x=nil
		c=0
		n.times{|i|
			if A[i]%p==0
				A[i]/=p
				x=i
				c+=1
			end
		}
		if c==n-1
			B[x]*=p
		else
			f=false
		end
	end
}
p B.max*r