require 'prime' class Integer def divisor_list return [] if self <= 0 return [1] if self == 1 prime_division.map{|e| [*(0..e.last)].map{|v| e.first ** v }}.inject{|res, e| res.map{|t| e.map{|v| t * v}}.flatten}.sort end end class Yukicoder def initialize n = gets.to_i puts n.divisor_list.find{|i| i > 2} end end Yukicoder.new