M = gets.to_i def get_divisor(d) for i in 2..d-1 do if d % i == 0 return i end end 1 end d = get_divisor(M) puts "#{M/d} #{d}"