#include <bits/stdc++.h>
const int N = 100, MOD = 1e9;
using namespace std;
int n, m, g[N + 9][N + 9], op[N + 9][N + 9], f;
queue<pair<bool, int> > q;
bool ok() {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (op[i][j] != g[i][j]) return 0;
  return 1;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) scanf("%d", &g[i][j]);
  for (int i = 0; i < n && n <= m; ++i) {
    int minr = MOD;
    for (int k = 0; k < m; ++k) minr = min(minr, g[i][k]);
    for (int k = 0; k < m; ++k) op[i][k] = minr;
    for (int k = 0; k < minr; ++k) q.push({0, i + 1});
    f = 1;
  }
  for (int i = 0; i < m; ++i) {
    int minc = MOD;
    for (int k = 0; k < n; ++k) minc = min(minc, g[k][i] - op[k][i]);
    for (int k = 0; k < n; ++k) op[k][i] += minc;
    for (int k = 0; k < minc; ++k) q.push({1, i + 1});
  }
  for (int i = 0; i < n && !f; ++i) {
    int minr = MOD;
    for (int k = 0; k < m; ++k) minr = min(minr, g[i][k] - op[i][k]);
    for (int k = 0; k < m; ++k) op[i][k] += minr;
    for (int k = 0; k < minr; ++k) q.push({0, i + 1});
  }
  if (ok()) {
    printf("%d\n", (int)q.size());
    while (!q.empty()) {
      printf("%s %d\n", (q.front().first ? "col" : "row"), q.front().second);
      q.pop();
    }
  } else
    puts("-1");
  return 0;
}
