N=gets.to_i
list=gets.chomp.split(" ").map(&:to_i)
index=0
val=list[0]
for i in 1..N-1
  if(val>val.gcd(list[i]))
    index=i
    val=val.gcd(list[i])
  end
end
if index==1
  if list[1].gcd(list[0])<list[1].gcd(list[2])
    index=0
  end
end
class Array
  def gcd
    self.inject{|a,b| a.gcd(b)}
  end
end
list.slice!(index)
print (list.gcd)