import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
long number = sc.nextLong();
int boundary = (int) Math.sqrt(number);
for (int i = 2; i <= boundary; i++) {
while (number % i == 0) { // can be divided
System.out.print(i + " ");
number /= i;
}
}
if (number != 1) {
System.out.print(number);
}
}
}
}