#include <bits/stdc++.h>
using namespace std;
int p[105][105];
int row[105], col[105];
int n, m, i, j, ans;
void row_operate() {
  for (i = 1; i <= n; i++) {
    row[i] = 0x3f3f3f3f;
    for (j = 1; j <= m; j++) {
      if (p[i][j] < row[i]) {
        row[i] = p[i][j];
      }
    }
    for (j = 1; j <= m; j++) {
      p[i][j] -= row[i];
    }
    ans += row[i];
  }
}
void col_operate() {
  for (j = 1; j <= m; j++) {
    col[j] = 0x3f3f3f3f;
    for (i = 1; i <= n; i++) {
      if (p[i][j] < col[j]) {
        col[j] = p[i][j];
      }
    }
    for (i = 1; i <= n; i++) {
      p[i][j] -= col[j];
    }
    ans += col[j];
  }
}
int main() {
  cin >> n >> m;
  ans = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> p[i][j];
    }
  }
  if (n <= m) {
    row_operate();
    col_operate();
  } else {
    col_operate();
    row_operate();
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (p[i][j]) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
  for (i = 1; i <= n; i++) {
    while (row[i]--) cout << "row " << i << endl;
  }
  for (j = 1; j <= m; j++) {
    while (col[j]--) cout << "col " << j << endl;
  }
  return 0;
}
