#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const long long INF = (long long)1e18;
using namespace std;
int g[150][150];
int minr[150], minc[150];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  memset(minr, 0x3f3f3f3f, sizeof(minr)),
      memset(minc, 0x3f3f3f3f, sizeof(minc));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cin >> g[i][j];
  }
  int sum = 0;
  if (n <= m) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) minr[i] = min(minr[i], g[i][j]);
      sum += minr[i];
      for (int j = 1; j <= m; j++) g[i][j] -= minr[i];
    }
    for (int j = 1; j <= m; j++) {
      for (int i = 1; i <= n; i++) minc[j] = min(minc[j], g[i][j]);
      sum += minc[j];
      for (int i = 1; i <= n; i++) g[i][j] -= minc[j];
    }
  } else {
    for (int j = 1; j <= m; j++) {
      for (int i = 1; i <= n; i++) minc[j] = min(minc[j], g[i][j]);
      sum += minc[j];
      for (int i = 1; i <= n; i++) g[i][j] -= minc[j];
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) minr[i] = min(minr[i], g[i][j]);
      sum += minr[i];
      for (int j = 1; j <= m; j++) g[i][j] -= minr[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (g[i][j]) {
        cout << "-1" << endl;
        return 0;
      }
  }
  cout << sum << endl;
  for (int i = 1; i <= n; i++)
    if (minr[i]) {
      for (int k = 1; k <= minr[i]; k++) cout << "row " << i << endl;
    }
  for (int i = 1; i <= m; i++)
    if (minc[i]) {
      for (int k = 1; k <= minc[i]; k++) cout << "col " << i << endl;
    }
  return 0;
}
