n = int(input()) prime_factor_list = [] """ Important Notes: 1. We iterate from 2 to (square root of n)+1 because we do not need to iterate beyond this number. The reason is that any factor beyond this number would be multiple of the prime numbers covered previously. 2. We use the for-while loop structure to handle the case where we need to repeatedly append the same factor to the list. """ for i in range(2, int(n**0.5)+1): while n%i == 0: prime_factor_list.append(i) n = n//i if n > 2: prime_factor_list.append(n) print(" ".join(map(str, prime_factor_list)))