#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //constexpr long long MAX = 5100000; constexpr long long INF = 1LL << 60; constexpr int inf = 1000000007; constexpr long long mod = 1000000007LL; //constexpr long long mod = 998244353LL; const long double PI = acos((long double)(-1)); using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; int main() { /* cin.tie(nullptr); ios::sync_with_stdio(false); */ vector v; int k; cin >> k; if (k == 0) { puts("1\n1"); return 0; } int kkt = 89; while (kkt) { int n = v.size(); int nxt = n + 1; if (nxt * (nxt - 1) / 2 + nxt * 2 > k) break; v.emplace_back(1); } int one = v.size(); int t = v.size() * (v.size() - 1) / 2; if (t + one < k) { t += one; v.emplace_back(2); } if (t + one < k) v.emplace_back(6), t += one; while (t + 2 < k) { v.emplace_back(5); t += 2; } if (t < k) v.emplace_back(3); cout << v.size() << "\n"; for (int i = 0; i < v.size(); i++) cout << v[i] << " \n"[i + 1 == v.size()]; return 0; }