#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; typedef unsigned long long ull; typedef pair P; typedef pair> PP; const ll MOD = 1e9 + 7; const ll INF = 1 << 30; const ll INF2 = 9e18; const double INF3 = 9e14; const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 }; const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 }; #define ALL(x) (x).begin(),(x).end() #define pb push_back #define fr first #define sc second int rr(ll p) { int cnt = 0; if (p == 1)return 1; while (p > 1) { if (p % 2 == 1)return 0; p /= 2; cnt++; } return cnt; } int main() { ll k; cin >> k; if (k == 0) { cout << 1 << endl; cout << 1 << endl; return 0; } if (k == 1) { cout << 2 << endl; cout << 1 << ' ' << 1 << endl; return 0; } for (int i = 2;i <= 30;i++) { if (k % (i*(i - 1) / 2) == 0 && rr(k / ((i*(i - 1))/2))&& rr(k /( (i*(i - 1))/2)) <= 30 - i) { cout << i + rr(k / ((i*(i - 1) / 2)))<