#include <bits/stdc++.h>
using namespace std;
int a[105][105], ll[105], rr[105], l[105], r[105];
int main() {
  int n, m, i, j, k, s, t, a1, b1, ans, p, ii;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  ans = 999999;
  p = 1;
  for (i = 2; i <= n; i++)
    for (j = 2; j <= m; j++)
      if (a[i][j] - a[i - 1][j] != a[i][1] - a[i - 1][1]) p = 0;
  for (i = 2; i <= m; i++)
    for (j = 2; j <= n; j++)
      if (a[j][i] - a[j][i - 1] != a[1][i] - a[1][i - 1]) p = 0;
  if (p == 0)
    printf("-1\n");
  else {
    for (ii = 0; ii <= a[1][1]; ii++) {
      p = 1;
      l[1] = ii;
      r[1] = a[1][1] - ii;
      s = a[1][1];
      for (i = 2; i <= n; i++) {
        l[i] = l[i - 1] + a[i][1] - a[i - 1][1];
        s += l[i];
        if (l[i] < 0) {
          p = 0;
          break;
        }
      }
      for (i = 2; i <= m; i++) {
        r[i] = r[i - 1] + a[1][i] - a[1][i - 1];
        s += r[i];
        if (r[i] < 0) {
          p = 0;
          break;
        }
      }
      if (p == 1) {
        if (s < ans) {
          ans = s;
          for (i = 1; i <= n; i++) ll[i] = l[i];
          for (i = 1; i <= m; i++) rr[i] = r[i];
        }
      }
    }
    printf("%d\n", ans);
    for (i = 1; i <= n; i++)
      for (j = 1; j <= ll[i]; j++) printf("row %d\n", i);
    for (i = 1; i <= m; i++)
      for (j = 1; j <= rr[i]; j++) printf("col %d\n", i);
  }
  return 0;
}
