func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 105;   const int oo = 1e9;   int g[N][N], n, m;   int col[N];   vector<pair<int, int> > ans;   pair<int, int> get(int val) {     for (int i = 1; i <= m; ++i) {       if (g[1][i] < val) return {oo, val};     }     memset(col, 0, sizeof(col));     ans.clear();     int ret = val;     for (int i = 1; i <= m; ++i) col[i] = g[1][i] - val;     ans.push_back({1, val});     for (int i = 2; i <= n; ++i) {       int mn = oo, mx = -oo;       for (int j = 1; j <= m; ++j) {         if (g[i][j] < col[j]) return {oo, val};         mn = min(mn, g[i][j] - col[j]);         mx = max(mx, g[i][j] - col[j]);       }       if (mn != mx) return {oo, val};       ans.push_back({i, mn});       ret += mn;     }     for (int i = 1; i <= m; ++i) {       ans.push_back({-i, col[i]});       ret += col[i];     }     return {ret, val};   }   int main() {     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; ++i) {       for (int j = 1; j <= m; ++j) {         scanf( %d , &g[i][j]);       }     }     pair<int, int> ret = {oo, -1};     for (int i = 0; i <= 500; ++i) ret = min(ret, get(i));     if (ret.first == oo) {       printf( -1 n );       return 0;     }     get(ret.second);     printf( %d n , ret.first);     for (auto u : ans) {       if (u.first < 0) {         for (int i = 1; i <= u.second; ++i) printf( col %d n , -u.first);       } else {         for (int i = 1; i <= u.second; ++i) printf( row %d n , u.first);       }     }     return 0;   }   