func_code_string: #include <bits/stdc++.h>   const int mxn = 105;   const int inf = 505;   int n;   int m;   int ans;   int row[mxn];   int col[mxn];   int mat[mxn][mxn];   inline void calcRow() {     for (int i = 1; i <= n; ++i) {       row[i] = inf;       for (int j = 1; j <= m; ++j)         if (row[i] > mat[i][j]) row[i] = mat[i][j];       for (int j = 1; j <= m; ++j) mat[i][j] -= row[i];       ans += row[i];     }   }   inline void calcCol() {     for (int j = 1; j <= m; ++j) {       col[j] = inf;       for (int i = 1; i <= n; ++i)         if (col[j] > mat[i][j]) col[j] = mat[i][j];       for (int i = 1; i <= n; ++i) mat[i][j] -= col[j];       ans += col[j];     }   }   signed main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; ++i)       for (int j = 1; j <= m; ++j) scanf( %d , &mat[i][j]);     if (n <= m)       calcRow(), calcCol();     else       calcCol(), calcRow();     bool flag = true;     for (int i = 1; i <= n; ++i)       for (int j = 1; j <= m; ++j)         if (mat[i][j]) flag = false;     if (flag) {       printf( %d n , ans);       for (int i = 1; i <= n; ++i)         for (int j = 1; j <= row[i]; ++j) printf( row %d n , i);       for (int j = 1; j <= m; ++j)         for (int i = 1; i <= col[j]; ++i) printf( col %d n , j);     } else       puts( -1 );   }   