#include <bits/stdc++.h>
using namespace std;
int g[109][109];
int n, m;
vector<pair<bool, int>> ans;
void do1() {
  for (int i = 0; i < n; i++) {
    while (true) {
      bool ok = true;
      for (int j = 0; j < m; j++) {
        if (g[i][j] == 0) ok = false;
      }
      if (!ok) break;
      ans.push_back({true, i + 1});
      for (int j = 0; j < m; j++) g[i][j]--;
    }
  }
}
void do2() {
  for (int j = 0; j < m; j++) {
    while (true) {
      bool ok = true;
      for (int i = 0; i < n; i++) {
        if (g[i][j] == 0) ok = false;
      }
      if (!ok) break;
      ans.push_back({false, j + 1});
      for (int i = 0; i < n; i++) g[i][j]--;
    }
  }
}
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]);
    }
  }
  if (n < m) {
    do1();
    do2();
  } else {
    do2();
    do1();
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (g[i][j]) {
        printf("-1");
        return 0;
      }
    }
  }
  printf("%d\n", ans.size());
  for (auto p : ans) {
    if (p.first) {
      printf("row ");
    } else {
      printf("col ");
    }
    printf("%d\n", p.second);
  }
}
