require'prime' n=gets.to_i x=n>1?Prime.prime_division(n)[0][0]:1 puts"#{x} #{n/x}"