#define PROBLEM "https://judge.yosupo.jp/problem/enumerate_quotients"
#include "../../cpp/template/template.cpp"
#include "../../cpp/math/quotients.cpp"
int main(){
long long n;cin>>n;
auto z = quotients(n);
cout << z.size() << endl;
for(int i = 0; z.size() > i; i++){
cout << z[i] << " \n"[i+1 == z.size()];
}
}
#line 1 "cpp/z_test/yosupo-enumerate_quotients.cpp"
#define PROBLEM "https://judge.yosupo.jp/problem/enumerate_quotients"
#line 2 "cpp/template/template.cpp"
//yukicoder@cpp17
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cctype>
#include <climits>
#include <cassert>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <random>
#include <bitset>
#include <complex>
#include <utility>
#include <numeric>
#include <functional>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 998244353;
const ll MODx = 1000000007;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62LL)-1;
const double EPS = (1e-10);
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
/* comment outed because can cause bugs
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
*/
#line 4 "cpp/z_test/yosupo-enumerate_quotients.cpp"
#line 1 "cpp/math/quotients.cpp"
vector<long long> quotients(long long x){
vector<long long> ret;
long long nw = 1;
while(!ret.size() || ret[ret.size()-1] != x/nw){
if(x < nw)break;
ret.push_back(x/nw);
nw++;
}
while(ret[ret.size()-1] != 1){
ret.push_back(ret[ret.size()-1]-1);
}
reverse(ret.begin(), ret.end());
return ret;
}
#line 6 "cpp/z_test/yosupo-enumerate_quotients.cpp"
int main(){
long long n;cin>>n;
auto z = quotients(n);
cout << z.size() << endl;
for(int i = 0; z.size() > i; i++){
cout << z[i] << " \n"[i+1 == z.size()];
}
}