#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 10;
const int INF = 0x7f7f7f7f;
int n, m;
int grid[MAXN][MAXN];
void oprow(vector<int>& rv) {
  for (int rr = 0; rr < n; rr++) {
    int mmin = INF;
    for (int kk = 0; kk < m; kk++) {
      mmin = min(mmin, grid[rr][kk]);
    }
    if (mmin == 0) continue;
    for (int kk = 0; kk < m; kk++) {
      grid[rr][kk] -= mmin;
    }
    while (mmin--) rv.push_back(rr);
  }
}
void opcol(vector<int>& cv) {
  for (int cc = 0; cc < m; cc++) {
    int mmin = INF;
    for (int kk = 0; kk < n; kk++) {
      mmin = min(mmin, grid[kk][cc]);
    }
    if (mmin == 0) continue;
    for (int kk = 0; kk < n; kk++) {
      grid[kk][cc] -= mmin;
    }
    while (mmin--) cv.push_back(cc);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  bool zero = true;
  for (int ii = 0; ii < n; ii++) {
    for (int jj = 0; jj < m; jj++) {
      cin >> grid[ii][jj];
    }
  }
  vector<int> rv, cv;
  if (n <= m) {
    oprow(rv);
    opcol(cv);
  } else {
    opcol(cv);
    oprow(rv);
  }
  bool ok = true;
  for (int ii = 0; ii < n; ii++) {
    for (int jj = 0; jj < m; jj++) {
      if (grid[ii][jj] != 0) ok = false;
    }
  }
  if (!ok)
    cout << -1 << endl;
  else {
    cout << rv.size() + cv.size() << endl;
    for (auto v : rv) {
      cout << "row"
           << " " << v + 1 << endl;
    }
    for (auto v : cv) {
      cout << "col"
           << " " << v + 1 << endl;
    }
  }
}
