public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long a = in.nextInt();
long up = (long) Math.sqrt(a);
String str = "";
for (int i = 2; i <= up;) {
if (a % i == 0) {
a = a / i;
System.out.print(i + " ");
str = str +i+" ";
} else {
i++;
}
}
System.out.println(a == 1 ? "": a+" ");
} import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int num = in.nextInt();
while (num % 2 == 0){
System.out.print(2 + " ");
num /= 2;
}
for(int i = 3;i <= num;){
if(num % i == 0){
System.out.print(i+" ");
num /= i;
}
else{
i += 2;
}
}
}
} import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int limit = in.nextInt();
for (int i = 2; i * i <= limit; i++) {
if (limit % i == 0) {
limit = limit / i;
System.out.print(i + " ");
i = i - 1;
}
}
System.out.print(limit);
}
} import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int number = in.nextInt();
decompose(number);
}
public static void decompose(int num) {
Map<Integer, Integer> map = new TreeMap<>();
int len = num;
// 质因子的范围是2~根号n
for(int i = 2; i * i <= len; i++) {
while(num % i == 0) {
map.put(i, map.getOrDefault(i, 0) + 1);
num /= i;
}
}
if(num > 1) {
map.put(num, map.getOrDefault(num, 0) + 1);
}
// 遍历并按照 key 从小到大打印,每个 key 打印 value 次
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
int key = entry.getKey();
int value = entry.getValue();
// 打印 key 对应的 value 次
for (int i = 0; i < value; i++) {
System.out.print(key + " ");
}
}
}
}