require "prime" STDOUT.sync = true N = gets.to_i ans = 1 primes = Prime.each(N).to_a primes.shuffle! primes.each_slice(4).take(600).each do |ps| x = ps.map { |p| y = 1 y *= p while y * p <= N y }.inject(1, :*) puts "? #{x}" ans *= gets.to_i end puts "! #{ans}"