#include typedef long long ll; using namespace std; const int N = 102; const int L = 100; ll temp_row[N]; ll tmp[N]; vector> cut; vector> harvested; int main() { ll n; scanf("%lld", &n); for(int i=1;i<=500;i++) { for(int j=1;j<=L;j++) { cut.emplace_back(2*i, j); } } for(int i=1;i<=L;i++) { temp_row[i] = 0; } temp_row[1] = 1; int day = 0; ll mx = 1; while(mx <= n/400) { for(int i=1;i<=L;i++) { tmp[i] = temp_row[i]; if(i>1) tmp[i] += temp_row[i-1]; if(i n || n == 0) { break; } n -= temp_row[k]; harvested.emplace_back(2*i, k); } } printf("%ld\n", cut.size()); for(auto z : cut) printf("%d %d %d\n", z.first, z.second, z.first == 0 || z.second == 1 ? 1 : 0); printf("%ld %d\n", harvested.size(), day); for(auto z : harvested) printf("%d %d\n", z.first, z.second); }