#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, num[110][110], mini[110], mini2[110], mini3[110], mini4[110];
  scanf("%d%d", &n, &m);
  int mm;
  for (int i = 0; i < n; i++) {
    mm = 510;
    for (int j = 0; j < m; j++) {
      scanf("%d", &num[i][j]);
      if (num[i][j] < mm) mm = num[i][j];
    }
    mini[i] = mm;
  }
  if (m > n) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) num[i][j] -= mini[i];
    }
    int before;
    for (int j = 0; j < m; j++) {
      before = num[0][j];
      for (int i = 0; i < n; i++) {
        if (num[i][j] != before) {
          puts("-1");
          return 0;
        }
      }
      mini2[j] = before;
    }
    int ans = 0;
    for (int i = 0; i < n; i++) ans += mini[i];
    for (int i = 0; i < m; i++) ans += mini2[i];
    printf("%d\n", ans);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < mini[i]; j++) printf("row %d\n", i + 1);
    for (int j = 0; j < m; j++)
      for (int i = 0; i < mini2[j]; i++) printf("col %d\n", j + 1);
  } else {
    int xx = 510;
    for (int j = 0; j < m; j++) {
      xx = 510;
      for (int i = 0; i < n; i++)
        if (num[i][j] < xx) xx = num[i][j];
      mini3[j] = xx;
      for (int i = 0; i < n; i++) num[i][j] -= mini3[j];
    }
    int before;
    for (int i = 0; i < n; i++) {
      before = num[i][0];
      for (int j = 0; j < m; j++) {
        if (num[i][j] != before) {
          puts("-1");
          return 0;
        }
      }
      mini4[i] = before;
    }
    int ans = 0;
    for (int i = 0; i < m; i++) ans += mini3[i];
    for (int i = 0; i < n; i++) ans += mini4[i];
    printf("%d\n", ans);
    for (int j = 0; j < m; j++)
      for (int i = 0; i < mini3[j]; i++) printf("col %d\n", j + 1);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < mini4[i]; j++) printf("row %d\n", i + 1);
  }
  return 0;
}
