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

tmp = nil
A.each_with_index do |a1, i|
  A[i+1..-1].each_with_index do |a2|
    n = a1.gcd(a2)

    if tmp.nil?
      tmp = n
    end

    if tmp != n
      puts [tmp, n].max
      exit
    end
  end
end

puts A.first
