#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ST first
#define ND second
#define PB push_back

int main() {
    ios_base::sync_with_stdio(0);
    ll num;
    cin >> num;
    cout << "10000\n";
    for(int i=0; i < 100; i++) {
        for(int j=0; j < 100; j++) {
            cout << 2*i << " " << j << " " << (j == 0 ? 1 : 0) << "\n";
        }
    }
    int shift=52;
    vector<ll> values {997288124829735480, 226781671119121944, 48853949126863980, 9939021397749696, 1902836579794695, 341436240984090, 57151543384740, 8875085152500, 1270351604235, 166303271460, 19723273605, 2094233536, 196103635, 15875244, 1081045, 59500, 2484, 70, 1};

    vector<pii> res;
    int k = 0;
    int maxx = 0;
    while(num > 0) {
        int x = 0;
        while(num >= values[k]) {
            num-=values[k];
            res.PB({x, shift+k});
            x+=2;
            maxx = max(maxx, x);
        }
        k++;
        // cerr << num << "\n";
    }
    cout << res.size() << " " << 70 << "\n";
    for(pii p : res) {
        cout << p.ST << " " << p.ND << "\n";
    }
    // cerr << "maxx: " << ma   xx << "\n";
}