#include <bits/stdc++.h>
using namespace std;
int grid[105][105];
struct step {
  int rc, n;
};
int main() {
  int n, m;
  cin >> n >> m;
  int flag = true;
  if (n < m)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) scanf("%d", &grid[i][j]);
  else {
    flag = false;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) scanf("%d", &grid[j][i]);
    swap(n, m);
  }
  list<step> ans;
  bool psb = true;
  for (int i = 1; i <= n; i++) {
    while (count(grid[i] + 1, grid[i] + 1 + m, 0) == 0) {
      for (int j = 1; j <= m; j++) grid[i][j]--;
      step tmp;
      tmp.n = i;
      tmp.rc = 0;
      ans.push_back(tmp);
    }
  }
  for (int j = 1; j <= m && psb; j++) {
    while (psb) {
      int cnt = 0;
      for (int i = 1; i <= n; i++) {
        if (grid[i][j] == 0) cnt++;
      }
      if (cnt == 0) {
        for (int i = 1; i <= n; i++) {
          grid[i][j]--;
        }
        step tmp;
        tmp.n = j;
        tmp.rc = 1;
        ans.push_back(tmp);
      } else if (cnt < n) {
        psb = false;
      } else
        break;
    }
  }
  if (psb) {
    cout << ans.size() << endl;
    for (auto &e : ans)
      cout << ((!flag) ^ e.rc == 0 ? "row " : "col ") << e.n << endl;
  } else
    cout << -1 << endl;
}
