#include <bits/stdc++.h>
using namespace std;
int g[110][110], row[110], col[110];
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) > 0) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        scanf("%d", &g[i][j]);
      }
    }
    int r0, best = (1 << 30);
    for (row[0] = 0; true; row[0]++) {
      bool test = true;
      int ans = row[0];
      for (int j = 0; j < m; j++) {
        if (g[0][j] < row[0]) {
          test = false;
          break;
        }
        col[j] = g[0][j] - row[0];
        ans += col[j];
      }
      if (!test) break;
      for (int i = 1; i < n and test; i++) {
        if (g[i][0] < col[0]) {
          test = false;
          break;
        }
        row[i] = g[i][0] - col[0];
        ans += row[i];
        for (int j = 1; j < m; j++) {
          if (row[i] + col[j] != g[i][j]) {
            test = false;
            break;
          }
        }
      }
      if (test and ans < best) {
        best = ans;
        r0 = row[0];
      }
    }
    if (best == (1 << 30)) {
      printf("-1\n");
      continue;
    }
    printf("%d\n", best);
    row[0] = r0;
    for (int j = 0; j < m; j++) {
      col[j] = g[0][j] - row[0];
    }
    for (int i = 1; i < n; i++) {
      row[i] = g[i][0] - col[0];
    }
    for (int i = 0; i < n; i++) {
      while (row[i]--) printf("row %d\n", i + 1);
    }
    for (int j = 0; j < m; j++) {
      while (col[j]--) printf("col %d\n", j + 1);
    }
  }
}
