#include using namespace std; using LL = long long int; using uLL = unsigned long long int; using uint = unsigned int; using ld = long double; vector XX = {1, 40, 781, 10699, 111930, 952679, 6854991, 42807076, 236425930, 1171510132, 5266202526, 21667426625, 82190243928, 289163217034, 948344607691, 2911734517204, 8400366899103, 22844889309674, 58725940450824, 143046835486636, 330876188328202, 728142112180096, 1527081246166200, 3056716613495522, 5847585576350190, 10703988092800330, 18768359634342802, 31552465935381004, 50902211795990382, 78861672986978606, 117412404571787484, 168089015379285322, 231509732709569395, 306903336634526551, 391747934008399296, 481646962846454792, 570541698801787599, 651295465000011244, 716594476889546518, 760017927757437067, 777065183187931563, 765915421372973519, 727744238704504563, 666521898622449250, 588340588015952365, 500426755178952853, 410057762462133210, 323604027018451391, 245863328529360486, 179764908827001541, 126427048802923189, 85479506064697723, 55526739546509103, 34630394316476963, 20719887904522425, 11882581721864605, 6525313208488531, 3427541966425081, 1719978241959135, 823430502855647, 375516192240711, 162847365045025, 67025839587553, 26125452601129, 9619862762226, 3336802773344, 1086781322733, 331115577199, 93961943074, 24707926231, 5983961307, 1325017916, 265844370, 47787832, 7586110, 1043329, 121068, 11402, 819, 40, 1}; LL tab[10][81]; const LL INF = 8380; pair find(LL x){ LL maks = 0; for(int i = 0; i < 10; i++){ for(int j = 0; j < 81; j++){ if(tab[i][j] <= x){ maks = max(maks, tab[i][j]); } } } for(int i = 0; i < 10; i++){ for(int j = 0; j < 81; j++){ if(tab[i][j] == maks){ return {i, j}; } } } return {-1, -1}; } int main(){ cin.tie(NULL); ios_base::sync_with_stdio(0); for(int i = 0; i < 10; i++){ for(int j = 0; j < 81; j++){ tab[i][j] = XX[j]; } } LL N; cin >> N; cout << 10000 << '\n'; for(int i = 0; i < 20; i += 2){ for(int j = 0; j < 81; j++){ cout << j << " " << i << " "; if(j == 40){ cout << 1 << '\n'; } else{ cout << 0 << '\n'; } } } for(int i = 0; i < 8380; i++){ cout << -100 << " " << 2*i << " " << 1 << '\n'; } vector > ans; while(N > 8380){ pair id = find(N); N -= tab[id.first][id.second]; tab[id.first][id.second] = 0; id.first *= 2; swap(id.first, id.second); ans.push_back(id); } for(int i = 0; i < N; i++){ ans.push_back({-100, 2*i}); } cout << ans.size() << " " << 40 << '\n'; for(auto x: ans){ cout << x.first << " " << x.second << '\n'; } return 0; }