#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
for ( int i = 1; i < sqrt ( n ); i++ ) {
if ( n % i == 0 ) cout << i << " ";
}
for ( int i = sqrt ( n ); i >= 1; i-- ) {
if ( n % i == 0 ) cout << n / i << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCBuOwoJY2luID4+IG47Cglmb3IgKCBpbnQgaSA9IDE7IGkgPCBzcXJ0ICggbiApOyBpKysgKSB7CgkJaWYgKCBuICUgaSA9PSAwICkgY291dCA8PCBpIDw8ICIgIjsgCgl9Cglmb3IgKCBpbnQgaSA9IHNxcnQgKCBuICk7IGkgPj0gMTsgaS0tICkgewoJCWlmICggbiAlIGkgPT0gMCApIGNvdXQgPDwgbiAvIGkgPDwgIiAiOwoJfSAKCXJldHVybiAwOwp9