#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 7;
const int inf = 1e9;
int n, m;
int g[MAXN][MAXN];
int r[MAXN], c[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &g[i][j]);
  int flag;
  if (n < m) {
    for (int i = 1; i <= n; ++i) {
      r[i] = inf;
      for (int j = 1; j <= m; ++j) {
        r[i] = min(r[i], g[i][j]);
      }
    }
    flag = 1;
    for (int i = 1; i <= n; ++i)
      if (flag) {
        for (int j = 1; j <= m; ++j) {
          if (g[i][j] >= r[i] + c[j]) {
            c[j] += g[i][j] - r[i] - c[j];
          } else {
            flag = 0;
            break;
          }
        }
      }
    for (int i = 1; i <= n; ++i)
      if (flag)
        for (int j = 1; j <= m; ++j) {
          if (g[i][j] != r[i] + c[j]) {
            flag = 0;
            break;
          }
        }
  } else {
    for (int j = 1; j <= m; ++j) {
      c[j] = inf;
      for (int i = 1; i <= n; ++i) {
        c[j] = min(c[j], g[i][j]);
      }
    }
    flag = 1;
    for (int j = 1; j <= m; ++j)
      if (flag) {
        for (int i = 1; i <= n; ++i) {
          if (g[i][j] >= r[i] + c[j]) {
            r[i] += g[i][j] - r[i] - c[j];
          } else {
            flag = 0;
            break;
          }
        }
      }
    for (int i = 1; i <= n; ++i)
      if (flag)
        for (int j = 1; j <= m; ++j) {
          if (g[i][j] != r[i] + c[j]) {
            flag = 0;
            break;
          }
        }
  }
  if (!flag) {
    puts("-1");
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans += r[i];
  for (int i = 1; i <= m; ++i) ans += c[i];
  printf("%d\n", ans);
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < r[i]; ++j) printf("row %d\n", i);
  for (int i = 1; i <= m; ++i)
    for (int j = 0; j < c[i]; ++j) printf("col %d\n", i);
}
