#include using namespace std; typedef long long ll; typedef double lf; typedef long double Lf; typedef pair pii; typedef pair pll; #define TRACE(x) cerr << #x << " " << x << endl #define FOR(i, a, b) for (int i = (a); i < int(b); i++) #define REP(i, n) FOR(i, 0, n) #define all(x) (x).begin(), (x).end() #define _ << " " << #define fi first #define sec second #define mp make_pair #define pb push_back const int MAXN = 400; ll a[MAXN]; ll b[MAXN]; vector> flowers; int main() { ll x; cin >> x; a[200] = 1; REP(j, MAXN) flowers.pb({a[j], {0, j}}); cout << flowers.size() << endl; for (auto pp : flowers) { cout << pp.second.first << " " << pp.second.second << " " << pp.first << endl; } int days = 0; ll maxi = 0; do { days ++; maxi = 0; FOR(j, 1, MAXN - 1) { b[j] = a[j] + a[j - 1] + a[j + 1]; } REP(j, MAXN) { a[j] = b[j]; maxi = max(maxi, a[j]); } } while (maxi * 2 < x); vector> candidates; REP(j, MAXN) { candidates.pb({a[j], {0, j}}); } sort(candidates.begin(), candidates.end()); vector sol; while(candidates.size()) { auto pp = candidates.back(); candidates.pop_back(); if (pp.first == 0) continue; while (pp.first <= x) { x -= pp.first; sol.pb(pp.second); } } assert(sol.size() <= 10000); assert(days <= 100); assert(x == 0); cout << sol.size() << " " << days << endl; for (auto pp : sol) { cout << pp.first << " " << pp.second << endl; } return 0; }