func_code_string: #include <bits/stdc++.h>   using namespace std;   void SieveOfErat() {     bool prime[1000001];     memset(prime, true, sizeof(prime));     for (long long p = 2; p * p <= 1000000; p++) {       if (prime[p] == true) {         for (long long i = p * 2; i <= 1000000; i += p) prime[i] = false;       }     }   }   long long gcd(long long x, long long y) {     if (x == 0) {       return y;     } else       return gcd(x % y, y);   }   long long n, m;   vector<vector<long long> > v;   vector<long long> res;   signed main() {     ios_base::sync_with_stdio(false);     cin >> n >> m;     v.assign(n, vector<long long>(m, 0));     for (long long i = 0; i < n; ++i) {       for (long long j = 0; j < m; ++j) cin >> v[i][j];     }     if (n < m) {       for (long long i = 0; i < n; ++i) {         long long mi = 600;         for (long long j = 0; j < m; ++j) mi = min(mi, v[i][j]);         if (mi == 0) continue;         for (long long j = 0; j < mi; ++j) res.push_back(i + 1);         for (long long j = 0; j < m; ++j) v[i][j] -= mi;       }       for (long long j = 0; j < m; ++j) {         long long mi = 600;         for (long long i = 0; i < n; ++i) mi = min(mi, v[i][j]);         if (mi == 0) continue;         for (long long i = 0; i < mi; ++i) res.push_back(-(j + 1));         for (long long i = 0; i < n; ++i) v[i][j] -= mi;       }     } else {       for (long long j = 0; j < m; ++j) {         long long mi = 600;         for (long long i = 0; i < n; ++i) mi = min(mi, v[i][j]);         if (mi == 0) continue;         for (long long i = 0; i < mi; ++i) res.push_back(-(j + 1));         for (long long i = 0; i < n; ++i) v[i][j] -= mi;       }       for (long long i = 0; i < n; ++i) {         long long mi = 600;         for (long long j = 0; j < m; ++j) mi = min(mi, v[i][j]);         if (mi == 0) continue;         for (long long j = 0; j < mi; ++j) res.push_back(i + 1);         for (long long j = 0; j < m; ++j) v[i][j] -= mi;       }     }     long long sum = 0;     for (long long i = 0; i < n; ++i)       for (long long j = 0; j < m; ++j) sum += v[i][j];     if (sum > 0) {       cout << -1 << endl;       return 0;     }     cout << res.size() <<   n ;     for (long long i = 0; i < res.size(); ++i) {       if (res[i] > 0)         cout <<  row   << res[i] <<   n ;       else         cout <<  col   << -res[i] <<   n ;     }     return 0;   }   