require 'prime' m = gets.to_i x = Prime.prime_division(m).to_a[0][0] puts "#{x} #{m / x}"