#include <bits/stdc++.h>
using namespace std;
int ans, n, m, a[110], b[110], ansa[110], ansb[110], g[110][110], i, j, k;
int main() {
  ans = -1;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &g[i][j]);
  for (k = 0; k <= g[1][1]; k++) {
    a[1] = k;
    bool flag = 1;
    for (j = 1; j <= m; j++) {
      b[j] = g[1][j] - a[1];
      if (b[j] < 0) {
        flag = 0;
        break;
      }
    }
    if (!flag) continue;
    for (i = 2; i <= n; i++) {
      a[i] = g[i][1] - b[1];
      if (a[i] < 0) {
        flag = 0;
        break;
      }
    }
    if (!flag) continue;
    for (i = 1; i <= n; i++)
      for (j = 1; j <= m; j++) {
        if (a[i] + b[j] != g[i][j]) {
          flag = 0;
          break;
        }
      }
    if (flag) {
      int tot = 0;
      for (i = 1; i <= n; i++) tot += a[i];
      for (j = 1; j <= m; j++) tot += b[j];
      if (ans == -1 || ans > tot) {
        ans = tot;
        for (i = 1; i <= n; i++) ansa[i] = a[i];
        for (j = 1; j <= m; j++) ansb[j] = b[j];
      }
    }
  }
  printf("%d\n", ans);
  if (ans == -1) return 0;
  for (i = 1; i <= n; i++)
    for (k = 1; k <= ansa[i]; k++) printf("row %d\n", i);
  for (i = 1; i <= m; i++)
    for (k = 1; k <= ansb[i]; k++) printf("col %d\n", i);
}
