#include <iostream>
#include <set>
#include <string>
#include <cmath>
using namespace std;
void factors(unsigned long long u, set<unsigned long long>& fac)
{
unsigned long long s = sqrt(u);
for(unsigned long long i(2); i < s; ++i)
{
if(u % i == 0)
{
u /= i;
fac.insert(i);
fac.insert(u);
}
}
}
int main()
{
set<unsigned long long> fac;
unsigned long long num(64);
factors(num, fac);
for(auto i : fac)
cout << i <<endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y21hdGg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBmYWN0b3JzKHVuc2lnbmVkIGxvbmcgbG9uZyB1LCBzZXQ8dW5zaWduZWQgbG9uZyBsb25nPiYgZmFjKQp7CiAgICB1bnNpZ25lZCBsb25nIGxvbmcgcyA9IHNxcnQodSk7CiAgICAKICAgIGZvcih1bnNpZ25lZCBsb25nIGxvbmcgaSgyKTsgaSA8IHM7ICsraSkKICAgIHsKICAgICAgICBpZih1ICUgaSA9PSAwKQogICAgICAgIHsKICAgICAgICAgICAgdSAvPSBpOwogICAgICAgICAgICBmYWMuaW5zZXJ0KGkpOwogICAgICAgICAgICBmYWMuaW5zZXJ0KHUpOyAgICAgICAgICAgIAogICAgICAgIH0KICAgIH0KfQoKaW50IG1haW4oKQp7CiAgICBzZXQ8dW5zaWduZWQgbG9uZyBsb25nPiBmYWM7CiAgICAKICAgIHVuc2lnbmVkIGxvbmcgbG9uZyBudW0oNjQpOwogICAgCiAgICBmYWN0b3JzKG51bSwgZmFjKTsKICAgIAogICAgZm9yKGF1dG8gaSA6IGZhYykKICAgICAgICBjb3V0IDw8IGkgPDxlbmRsOwp9Cg==