n = gets().to_i
a = gets().split(' ').map(&:to_i).uniq()

def ag(l)
  ln = l.length
  if ln == 1
    return l[0]
  end
  b = []
  f = nil
  for i in 0..(ln - 2)
    f = l[i].gcd(l[i + 1])
  end
  f
end

c = []
for i in 0..(n-1)
    na = a.clone
    na.delete_at(i)
    c.push(ag(na))
end
  
print(c.max)