#include <bits/stdc++.h>
using namespace std;
const int N = 555;
int a[N][N], tmp[N][N];
pair<string, int> q[N * N];
void transpose(int& n, int& m) {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      tmp[j][i] = a[i][j];
    }
  }
  swap(n, m);
  memcpy(a, tmp, sizeof a);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  bool transposed = false;
  if (n > m) {
    transpose(n, m);
    transposed = true;
  }
  int sz = 0;
  for (int k = 0; k < 2; ++k) {
    for (int i = 0; i < n; ++i) {
      int mn = N;
      for (int j = 0; j < m; ++j) {
        mn = min(mn, a[i][j]);
      }
      for (int j = 0; j < m; ++j) {
        a[i][j] -= mn;
      }
      while (mn--) {
        q[sz++] = {transposed ? "col" : "row", i + 1};
      }
    }
    transpose(n, m);
    transposed ^= 1;
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cnt += a[i][j];
    }
  }
  if (cnt != 0) {
    puts("-1");
    return 0;
  }
  printf("%d\n", sz);
  for (int i = 0; i < sz; ++i) {
    printf("%s %d\n", q[i].first.c_str(), q[i].second);
  }
}
