require 'prime'

n = gets.to_i
array = gets.split().map(&:to_i)

result = 0
(0..n-1).each do |i|
	array_tmp = array.dup
	array_tmp.delete_at(i)
	max = array_tmp.inject(:gcd)
	if max > result then result = max end
end

p result