require "prime" p Prime.prime_division(gets.to_i). select{|(i, c)| c.odd? }. map(&:first). reduce(&:*)