#include <bits/stdc++.h>
using namespace std;
int mat[200][200];
int temp[200][200];
int row[200];
int col[200];
int main() {
  int n, m;
  long long resp = 0;
  long long esp = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    row[i] = 200000;
    for (int j = 0; j < m; j++) {
      scanf("%d", &mat[i][j]);
      row[i] = min(row[i], mat[i][j]);
    }
  }
  if (n > m) {
    esp = 1;
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        temp[i][j] = mat[j][i];
      }
    }
    for (int i = 0; i < m; i++) {
      row[i] = 200000;
      for (int j = 0; j < n; j++) {
        mat[i][j] = temp[i][j];
        row[i] = min(row[i], mat[i][j]);
      }
    }
    int tempi = n;
    n = m;
    m = tempi;
  }
  for (int i = 0; i < n; i++) {
    resp += row[i];
    for (int j = 0; j < m; j++) {
      mat[i][j] = mat[i][j] - row[i];
    }
  }
  for (int j = 0; j < m; j++) {
    int mini = mat[0][j];
    col[j] = mini;
    resp += col[j];
    for (int i = 1; i < n; i++) {
      if (mat[i][j] != mini) {
        printf("-1\n");
        return 0;
      }
    }
  }
  printf("%lld\n", resp);
  for (int i = 0; i < n; i++) {
    while (row[i]) {
      if (!esp)
        printf("row %d\n", i + 1);
      else
        printf("col %d\n", i + 1);
      row[i]--;
    }
  }
  for (int j = 0; j < m; j++) {
    while (col[j]) {
      if (!esp)
        printf("col %d\n", j + 1);
      else
        printf("row %d\n", j + 1);
      col[j]--;
    }
  }
  return 0;
}
