#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 47
#endif
set<int> s;
void go(int n, int cnt, int sum, int prv) {
if (n == 1) {
s.insert(sum);
return;
}
if (cnt == 0) {
return;
}
for (int x = prv; ; x++) {
int to = 0;
if (cnt == 1) to = x;
else if (cnt == 2) to = x * x;
else if (cnt == 3) to = x * x * x;
else to = x * x * x * x;
if (to > n) break;
// int k = 1;
// for (int i = 0; i < cnt; i++) {
// k *= x;
// if (k > n) break;
// }
// if (k > n) break;
if (n % x != 0) continue;
go(n / x, cnt - 1, sum + x - 1, x);
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
go(n, 30, 0, 1);
cout << s.size() << '\n';
for (auto x : s) {
cout << x << ' ';
}
cout << '\n';
return 0;
}