require 'prime' i = gets.chomp.to_i a = i.prime_division.map {|p,n| [p]*n }.flatten s = a.inject{|s,n| s*n} puts i == 1 ? "1 1" : "#{a[0]} #{s/a[0]}"