#include <bits/stdc++.h>
using namespace std;
int n, m, a[105][105], r[105], ans = INT_MAX, mini = -1;
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]);
    }
  }
  for (int k = 0; k <= a[1][1]; k++) {
    bool ok = true;
    int cnt = 0;
    for (int i = 1; i <= m; i++) {
      r[i] = a[1][i] - k;
      cnt += r[i];
      if (r[i] < 0) ok = false;
    }
    for (int i = 1; i <= n; i++) {
      int c = a[i][1] - r[1];
      if (c < 0) ok = false;
      for (int j = 2; j <= m; j++) {
        if (a[i][j] - r[j] != c) ok = false;
      }
      cnt += c;
    }
    if (ok && cnt < ans) {
      ans = cnt;
      mini = k;
    }
  }
  if (mini == -1)
    printf("-1\n");
  else {
    printf("%d\n", ans);
    for (int i = 1; i <= m; i++) {
      r[i] = a[1][i] - mini;
      for (int j = 1; j <= r[i]; j++) printf("col %d\n", i);
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= a[i][1] - r[1]; j++) printf("row %d\n", i);
    }
  }
  return 0;
}
