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