#include <iostream>
#include <cmath>
#include <stack>
using namespace std;
int main() {
int n;
cin >> n;
stack < int > div;
const double sqrt_n = sqrt ( n );
for ( int i = 1; i <= sqrt_n; i++ ) {
if ( n % i == 0 ) {
div.push ( i );
cout << i << " ";
}
}
if ( div.top () == sqrt_n ) div.pop();
while ( !div.empty () ) {
cout << n / div.top () << " ";
div.pop ();
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxzdGFjaz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbiA+PiBuOwoJc3RhY2sgPCBpbnQgPiBkaXY7Cgljb25zdCBkb3VibGUgc3FydF9uID0gc3FydCAoIG4gKTsgCglmb3IgKCBpbnQgaSA9IDE7IGkgPD0gc3FydF9uOyBpKysgKSB7CgkgICAgaWYgKCBuICUgaSA9PSAwICkgewoJICAgIAlkaXYucHVzaCAoIGkgKTsKCSAgICAJY291dCA8PCBpIDw8ICIgIjsKCSAgICB9Cgl9CglpZiAoIGRpdi50b3AgKCkgPT0gc3FydF9uICkgZGl2LnBvcCgpOwoJd2hpbGUgKCAhZGl2LmVtcHR5ICgpICkgewoJICAgICAgICBjb3V0IDw8IG4gLyBkaXYudG9wICgpIDw8ICIgIjsKICAgICAgICAJZGl2LnBvcCAoKTsKCX0KCXJldHVybiAwOwp9