#include <bits/stdc++.h>
using namespace std;
const int siz = 5e3 + 5;
int t, n, m, f[siz][siz];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> f[i][j];
  vector<pair<int, int> > row, col;
  int op = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (f[i][j] == 0) continue;
      for (int z = 0; z < 2; z++) {
        int mn = 1e9;
        for (int k = 1; k <= n; k++) mn = min(mn, f[k][j]);
        int mn2 = 1e9;
        for (int k = 1; k <= m; k++) mn2 = min(mn2, f[i][k]);
        if ((mn != 0 and n >= m) or (mn != 0 and mn2 == 0)) {
          col.push_back({j, mn});
          op += mn;
          for (int k = 1; k <= n; k++) f[k][j] -= mn;
        } else {
          if (mn2 > 0) row.push_back({i, mn2});
          op += mn2;
          for (int k = 1; k <= m; k++) f[i][k] -= mn2;
        }
      }
      if (f[i][j] != 0) return cout << -1 << endl, 0;
    }
  }
  cout << op << endl;
  for (auto x : row) {
    int cnt = x.second, r = x.first;
    while (cnt--) cout << "row " << r << endl;
  }
  for (auto x : col) {
    int cnt = x.second, r = x.first;
    while (cnt--) cout << "col " << r << endl;
  }
}
