class Array
  def gcd
    self.inject {|a,b| a.gcd(b)} || 1
  end
end

n = gets.chomp!.to_i
a_n = gets.chomp!.split(" ").map!(&:to_i).sort
a_n_copy = a_n.dup

gcd_memo = []
gcd = a_n.gcd

#puts gcd # 最大公約数

nokori = a_n_copy.map {|x| x / gcd }

gcd_max = 1
n.times do |i|
  x = nokori[0..i]
  x.pop
  #print x
  #print ","
  y = nokori[i..(n -1)]
  y.shift
  #print y
  #puts ""

  gcd_max = [x.gcd.gcd(y.gcd), gcd_max].max
end

puts gcd * gcd_max
