#define _GLIBCXX_FILESYSTEM
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 2e5 + 10, MAXVAL = 1e9;
int a[MAXN];

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

vector <int> split(int s, int t) {
    assert(1 <= t && t <= s);

    vector <int> cuts;
    cuts.reserve(t - 1);

    unordered_set <int> used;

    uniform_int_distribution <int> dist(1, s - 1);

    while ((int)cuts.size() < t - 1) {
        int x = dist(rng);
        if (!used.count(x)) {
            used.insert(x);
            cuts.push_back(x);
        }
    }

    sort(cuts.begin(), cuts.end());

    vector <int> res;
    int prev = 0;

    for (int x : cuts) {
        res.push_back(x - prev);
        prev = x;
    }

    res.push_back(s - prev);

    return res;
}

int power(int base, int exp) {
    if (exp == 0) return 1;
    return base * power(base, exp - 1);
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int s;
    cin >> s;

    int t = max(1, (int) sqrt(rng() % 36) - 2);
    t = min(t, s);

    vector <int> v = split(s, t);

    cout << t << '\n';

    for (int i = 0; i < v.size(); i++) {
        int n = v[i];

        bool impossible = (i % 2 && rng() % 2);

        if (impossible) {
            int g = 2 + (int) sqrt(rng() % 10000);

            for (int i = 1; i <= n; i++) {
                a[i] = 1 + rng() % (MAXVAL / g);
                a[i] *= g;
            }
        } else {
            int g = 2 + (int) sqrt(rng() % 10000);

            for (int i = 1; i <= n; i++) {
                a[i] = 1 + rng() % (MAXVAL / g);
                a[i] *= g;
            }

            int idx = rng() % n + 1;

            a[idx] = rng() % MAXVAL + 1;
            a[idx] /= __gcd(a[idx], g);
        }

        cout << n << '\n';
    
        for (int i = 1; i <= n; i++) {
            if (i > 1) cout << ' ';
            cout << a[i];
        }
    
        cout << '\n';
    }


    return 0;

}