require "prime" P = 10 ** gets.to_i if P == 1 then puts 1 exit end x = Prime.prime_division(P).map{|x| (0..x[1]).map {|e| x[0] ** e}} v = x[0].size puts (0..v).to_a.repeated_permutation(2).to_a.map{|i| [x[0][i[0]], x[1][i[1]]]}.filter {|w| w.none?(&:nil?) }.map{|p| p.reduce(:*)}.sort