#include <bits/stdc++.h>
using namespace std;
int g[505][505];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> g[i][j];
  int best = -1;
  vector<int> best_a, best_b;
  for (int x = 0; x < 505; x++) {
    vector<int> a(n), b(m);
    a[0] = x;
    for (int j = 0; j < m; j++) b[j] = g[0][j] - x;
    for (int i = 0; i < n; i++) a[i] = g[i][0] - b[0];
    bool ok = 1;
    for (int i = 0; i < n; i++) ok &= a[i] >= 0;
    for (int j = 0; j < m; j++) ok &= b[j] >= 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) ok &= (a[i] + b[j] == g[i][j]);
    if (ok) {
      int total =
          accumulate(a.begin(), a.end(), 0) + accumulate(b.begin(), b.end(), 0);
      if (best == -1 || total < best) {
        best = total;
        best_a = a;
        best_b = b;
      }
    }
  }
  cout << best << endl;
  if (best != -1) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < best_a[i]; j++) cout << "row " << i + 1 << endl;
    for (int j = 0; j < m; j++)
      for (int i = 0; i < best_b[j]; i++) cout << "col " << j + 1 << endl;
  }
  return 0;
}
