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