#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, 820, 11440, 121810, 1053208, 7686640, 48619480, 271656775, 1360248760, 6172699936, 25614423640, 97908940090, 346834273360, 1144452379060, 3532910544712, 10241038789735, 27966124491760, 72147074769640, 176268499363840, 408737856117916, 901292170645360, 1893128300424400, 3793589020683280, 7262185615676290, 13297181761190704, 23313081572912800, 39175116255046960, 63149389866175060, 97726684134882400, 145292059950826984, 207644564206041040, 285418877356116205, 377513171664998200, 480667597492604860, 589346418663158416, 696040043832655990, 792020243653317640, 868469017357810960, 917789961841237960, 934837217271732457, 917789961841237960, 868469017357810960, 792020243653317640, 696040043832655990, 589346418663158416, 480667597492604860, 377513171664998200, 285418877356116205, 207644564206041040, 145292059950826984, 97726684134882400, 63149389866175060, 39175116255046960, 23313081572912800, 13297181761190704, 7262185615676290, 3793589020683280, 1893128300424400, 901292170645360, 408737856117916, 176268499363840, 72147074769640, 27966124491760, 10241038789735, 3532910544712, 1144452379060, 346834273360, 97908940090, 25614423640, 6172699936, 1360248760, 271656775, 48619480, 7686640, 1053208, 121810, 11440, 820, 40, 1}; LL tab[10][81]; const LL INF = 9190; 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 < INF; i++){ cout << -100 << " " << 2*i << " " << 1 << '\n'; } vector > ans; while(N > INF){ 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; }