#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
const int INF = 1000;
int a[N][N], n, m;
vector<pair<int, int> > ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  if (n < m) {
    for (int i = 0; i < n; i++) {
      int x = INF;
      for (int j = 0; j < m; j++) x = min(x, a[i][j]);
      for (int j = 0; j < x; j++) ans.push_back(pair<int, int>(i, 0));
      for (int j = 0; j < m; j++) a[i][j] -= x;
    }
    for (int i = 0; i < m; i++) {
      int x = INF;
      for (int j = 0; j < n; j++) x = min(x, a[j][i]);
      for (int j = 0; j < x; j++) ans.push_back(pair<int, int>(i, 1));
      for (int j = 0; j < n; j++) a[j][i] -= x;
    }
  } else {
    for (int i = 0; i < m; i++) {
      int x = INF;
      for (int j = 0; j < n; j++) x = min(x, a[j][i]);
      for (int j = 0; j < x; j++) ans.push_back(pair<int, int>(i, 1));
      for (int j = 0; j < n; j++) a[j][i] -= x;
    }
    for (int i = 0; i < n; i++) {
      int x = INF;
      for (int j = 0; j < m; j++) x = min(x, a[i][j]);
      for (int j = 0; j < x; j++) ans.push_back(pair<int, int>(i, 0));
      for (int j = 0; j < m; j++) a[i][j] -= x;
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j]) {
        printf("-1\n");
        return 0;
      }
  printf("%d\n", (int)ans.size());
  for (pair<int, int> it : ans) {
    if (it.second == 0)
      printf("row %d\n", it.first + 1);
    else
      printf("col %d\n", it.first + 1);
  }
  return 0;
}
