#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000000 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int a[n][m], i, j, k, sum = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
      sum += a[i][j];
    }
  int b[n], c[m];
  int mi = 0;
  if (n < m) {
    for (i = 0; i < n; i++) {
      mi = 501;
      for (k = 0; k < m; k++) {
        mi = min(mi, a[i][k]);
      }
      b[i] = mi;
      for (j = 0; j < m; j++) a[i][j] -= b[i];
    }
    for (j = 0; j < m; j++) {
      mi = 501;
      for (k = 0; k < n; k++) {
        mi = min(mi, a[k][j]);
      }
      c[j] = mi;
    }
  } else {
    for (j = 0; j < m; j++) {
      mi = 501;
      for (k = 0; k < n; k++) {
        mi = min(mi, a[k][j]);
      }
      c[j] = mi;
      for (k = 0; k < n; k++) a[k][j] -= c[j];
    }
    for (i = 0; i < n; i++) {
      mi = 501;
      for (k = 0; k < m; k++) {
        mi = min(mi, a[i][k]);
      }
      b[i] = mi;
    }
  }
  k = 0;
  int qqq = 0, www = 0;
  for (i = 0; i < n; i++) {
    k += b[i];
    qqq += b[i];
  }
  for (i = 0; i < m; i++) {
    k += c[i];
    www += c[i];
  }
  if (qqq * m + www * n != sum) {
    cout << "-1\n";
    return 0;
  }
  cout << k << "\n";
  for (i = 0; i < n; i++) {
    while (b[i]--) cout << "row " << i + 1 << "\n";
  }
  for (i = 0; i < m; i++) {
    while (c[i]--) cout << "col " << i + 1 << "\n";
  }
  return 0;
}
