#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e5 + 5;
int pri[N], tot, ans[10000005], len;
bool np[N];
inline bool isp(int n) {
if (n < N)
return !np[n];
for (int i = 0; i < tot && pri[i] * pri[i] <= n; ++ i) {
if (!(n % pri[i]))
return false;
}
return true;
}
void dfs(int mn, int cur, int res) {
if (res == 1) {
ans[len++] = cur;
return;
}
if (res - 1 >= pri[mn] && isp(res - 1))
ans[len++] = cur * (res - 1);
for (int j = mn; j < tot && pri[j] * pri[j] <= res; ++ j) {
int x = pri[j];
for (int sum = x + 1; sum <= res; x *= pri[j], sum += x) {
if (!(res % sum))
dfs(j + 1, cur * x, res / sum);
}
}
}
int main() {
cin.tie(0)->sync_with_stdio(false);
for (int i = 2; i < N; ++ i) {
if (!np[i])
pri[tot++] = i;
for (int j = 0; j < tot && i * pri[j] < N; ++ j) {
np[i * pri[j]] = true;
if (!(i % pri[j]))
break;
}
}
int n;
while (cin >> n) {
len = 0;
dfs(0, 1, n);
sort(ans, ans + len);
cout << len << endl;
for (int i = 0; i < len; ++ i) {
cout << ans[i] << " ";
if (i + 1 == len)
cout << endl;
}
}
return 0;
}