N = gets.to_i
A = gets.split(' ').map(&:to_i)

a = Array.new(N){|i| A[i]}

def gcd(a)
  gcd = a.min
  while a.any?{|n| n%gcd!=0}
    a = a.collect{|n| n%gcd}
    gcd = a.reject{|n| n == 0}.min
  end
  return gcd
end

gcd = gcd(a)

b = a.collect{|n| n/gcd}
gcd2 = 1
N.times do |i|
  c = gcd(b[0..i-1]+b[i+1..N-1]) if i>0
  c = gcd(b[1..N-1]) if i==0
  gcd2 = [gcd2, c].max
end

p gcd * gcd2