#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#include<math.h>
int main() {
// your code goes here
unordered_map<int,int>freq;
int n;
cin>>n;
int i=2;
while(n%i==0)
{
freq[i]++;
n=n/i;
}
for(i=3;i<=sqrt(n);i=i+2)
{
while(n%i==0)
{
freq[i]++;
n=n/i;
}
}
for(auto itr=freq.begin();itr!=freq.end();++itr){
cout<<itr->first<<" "<<itr->second;
cout<<"\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8bWF0aC5oPgoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCgl1bm9yZGVyZWRfbWFwPGludCxpbnQ+ZnJlcTsKCWludCBuOwoJY2luPj5uOwoJaW50IGk9MjsKCXdoaWxlKG4laT09MCkKCSB7CgkgCWZyZXFbaV0rKzsKCSAJbj1uL2k7CgkgfQoJIAoJIGZvcihpPTM7aTw9c3FydChuKTtpPWkrMikKCSAgewoJICAJd2hpbGUobiVpPT0wKQoJICAJIHsKCSAgCSAJZnJlcVtpXSsrOwoJICAJIAluPW4vaTsKCSAgCSB9CgkgIH0KCSAgCgkgIGZvcihhdXRvIGl0cj1mcmVxLmJlZ2luKCk7aXRyIT1mcmVxLmVuZCgpOysraXRyKXsKCQljb3V0PDxpdHItPmZpcnN0PDwiICI8PGl0ci0+c2Vjb25kOwoJCWNvdXQ8PCJcbiI7Cgl9CgkKCXJldHVybiAwOwp9