#include <bits/stdc++.h>
using namespace std;
void RI() {}
template <typename... T>
void RI(int& head, T&... tail) {
  scanf("%d", &head);
  RI(tail...);
}
void PI() { putchar('\n'); }
template <typename... T>
void PI(const int head, T... tail) {
  printf("%d ", head);
  PI(tail...);
}
const int MOD = 1000000007;
int grid[105][105];
vector<pair<int, int> > ansr, ansc;
char ss[2][5] = {"row", "col"};
int cnt = 0;
int n, m;
void subr() {
  for (int i = 0; i < (int)(n); i++) {
    int c = INT_MAX;
    for (int j = 0; j < (int)(m); j++) {
      c = min(c, grid[i][j]);
    }
    for (int j = 0; j < (int)(m); j++) {
      grid[i][j] -= c;
    }
    ansr.emplace_back(i, c);
    cnt += c;
  }
}
void subc() {
  for (int j = 0; j < (int)(m); j++) {
    int c = INT_MAX;
    for (int i = 0; i < (int)(n); i++) {
      c = min(c, grid[i][j]);
    }
    for (int i = 0; i < (int)(n); i++) {
      grid[i][j] -= c;
    }
    ansc.emplace_back(j, c);
    cnt += c;
  }
}
int main() {
  RI(n, m);
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      RI(grid[i][j]);
    }
  }
  if (n < m) {
    subr();
    subc();
  } else {
    subc();
    subr();
  }
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      if (grid[i][j] != 0) {
        printf("-1\n");
        return 0;
      }
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < (int)(ansr.size()); i++) {
    for (int k = 0; k < (int)(ansr[i].second); k++) {
      printf("row %d\n", ansr[i].first + 1);
    }
  }
  for (int i = 0; i < (int)(ansc.size()); i++) {
    for (int k = 0; k < (int)(ansc[i].second); k++) {
      printf("col %d\n", ansc[i].first + 1);
    }
  }
  return 0;
}
