```cpp
```cpp
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <queue>
#define ll long long
using namespace std;
vector <int> ve;
int num;
bool isPrime(int n)
{
for (int i= 2; i * i <= n; i++)
{
if (n % i == 0)
{
return false;
}
}
return true;
}
void primeList(int n)
{
for (int i = 2; i< n; i++)
{
if (isPrime(i))
{
ve.push_back(i);
}
}
}
int main()
{
cin >> num;
primeList(num);
int sqr = sqrt(num);
for (int i = 0; i < ve.size() && num != 1;)
{
if (num % ve[i] == 0)
{
num /= ve[i];
cout << ve[i] << " ";
}
else
{
i++;
}
}
return 0;
}