func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   using namespace std;   clock_t clk = clock();   long long int i, j, k;   void solve(void);   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     ;     int t = 1;     while (t--) solve();     return 0;   }   void solve() {     long long int n, m;     cin >> n >> m;     bool rev = 0;     for (i = 1; i <= (n + 1) / 2; ++i) {       for (j = 1; j <= m; ++j)         if (!rev) {           if (n + 1 != 2 * i) {             cout << i <<     << j <<   n ;             cout << n + 1 - i <<     << m + 1 - j <<   n ;           } else if (j & 1)             cout << i <<     << (j - 1) / 2 + 1 <<   n ;           else             cout << i <<     << m - j / 2 + 1 <<   n ;         } else {           if (n + 1 != 2 * i) {             cout << i <<     << m + 1 - j <<   n ;             cout << n + 1 - i <<     << j <<   n ;           } else if (j & 1)             cout << i <<     << m - (j - 1) / 2 <<   n ;           else             cout << i <<     << j / 2 <<   n ;         }       rev ^= 1;     }   }   