#include <iostream>
#include <vector>
#include<cstring>
#include <bitset>
#include <cstdio>
using namespace std;
int best[10000010];
bitset <10000010> isComposite;
void sieve ()
{
for (int i=2 ;i<=3163 ;i++)
{
if (i%2==0 && i!=2) continue;
if (isComposite[i]) continue;
for (int j=i*i ;j<=10000000;j+=i)
{
isComposite[j]=1;
if (best[j]==0) best[j] = j/i;
}
}
return ;
}
void solve (int num)
{
int ans = num;
while (best[ans]!=0)
{
printf(" x %d",ans
/best
[ans
]); ans = best[ans];
}
return ;
}
int main ()
{
sieve();
int n;
while (cin >> n)
{
if (!(isComposite
[n
])) printf(" x %d",n
); else solve(n);
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZTxjc3RyaW5nPgojaW5jbHVkZSA8Yml0c2V0PgojaW5jbHVkZSA8Y3N0ZGlvPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IGJlc3RbMTAwMDAwMTBdOwpiaXRzZXQgPDEwMDAwMDEwPiBpc0NvbXBvc2l0ZTsKdm9pZCBzaWV2ZSAoKQp7CiAgICBmb3IgKGludCBpPTIgO2k8PTMxNjMgO2krKykKICAgIHsKICAgICAgICBpZiAoaSUyPT0wICYmIGkhPTIpIGNvbnRpbnVlOwogICAgICAgIGlmIChpc0NvbXBvc2l0ZVtpXSkgY29udGludWU7CiAgICAgICAgZm9yIChpbnQgaj1pKmkgO2o8PTEwMDAwMDAwO2orPWkpCiAgICAgICAgewogICAgICAgICAgICBpc0NvbXBvc2l0ZVtqXT0xOwogICAgICAgICAgICBpZiAoYmVzdFtqXT09MCkgYmVzdFtqXSA9IGovaTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gOwp9CnZvaWQgc29sdmUgKGludCBudW0pCnsKICAgIGludCBhbnMgPSBudW07CiAgICB3aGlsZSAoYmVzdFthbnNdIT0wKQogICAgewogICAgICAgIHByaW50ZigiIHggJWQiLGFucy9iZXN0W2Fuc10pOwogICAgICAgIGFucyA9IGJlc3RbYW5zXTsKICAgIH0KICAgIHByaW50ZigiIHggJWQiLGFucyk7CiAgICByZXR1cm4gOwp9CmludCBtYWluICgpCnsKICAgIHNpZXZlKCk7CiAgICBpbnQgbjsKICAgIHdoaWxlIChjaW4gPj4gbikKICAgIHsKICAgICAgICBwcmludGYoIjEiKTsKICAgICAgICBpZiAoIShpc0NvbXBvc2l0ZVtuXSkpIHByaW50ZigiIHggJWQiLG4pOwogICAgICAgIGVsc2Ugc29sdmUobik7CiAgICAgICAgY291dCA8PCBlbmRsOwogICAgfQogICAgcmV0dXJuIDA7Cn0K