require 'prime' m = gets.to_i if m!=1 n = Prime.prime_division(m)[0][0] printf("%d %d",n,m/n) else puts "1 1" end