#include <bits/stdc++.h>
using namespace std;
int n, m, r[109], l[109], ans = 0, a[109][109];
int xx[109], yy[109];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  bool f = false;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int x = 1e9 + 7, y = 1e9 + 7;
      for (int k = 1; k <= m; k++) {
        x = min(x, a[i][k] - r[i] - l[k]);
      }
      for (int k = 1; k <= n; k++) {
        y = min(y, a[k][j] - r[k] - l[j]);
      }
      int yu = x + y;
      if (yu < a[i][j] - r[i] - l[j]) {
        f = true;
        break;
      }
      ans += a[i][j] - r[i] - l[j];
      if (n > m) {
        int yyy = l[j];
        l[j] += y;
        r[i] += a[i][j] - r[i] - yyy - y;
      } else {
        int yyy = r[i];
        r[i] += x;
        l[j] += a[i][j] - yyy - l[j] - x;
      }
    }
    if (f) break;
  }
  if (f) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; i++) {
    if (r[i]) {
      for (int j = 1; j <= r[i]; j++) printf("row %d\n", i);
    }
  }
  for (int i = 1; i <= m; i++) {
    if (l[i]) {
      for (int j = 1; j <= l[i]; j++) printf("col %d\n", i);
    }
  }
  return 0;
}
