#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans = INT_MAX, fmin = INT_MAX;
  cin >> n >> m;
  int a[n][m], mymin = INT_MAX;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
      if (i == 0) fmin = min(fmin, a[i][j]);
    }
  }
  vector<int> myx, myy;
  for (int x0 = 0; x0 <= fmin; ++x0) {
    vector<int> x(n, -1), y(m, -1);
    x[0] = x0;
    bool decex = true;
    for (int j = 0; j < m; ++j) {
      y[j] = a[0][j] - x0;
      if (y[j] < 0) {
        decex = false;
        break;
      }
      for (int i = 1; i < n; ++i) {
        if (x[i] < 0) x[i] = a[i][j] - y[j];
        if (x[i] != a[i][j] - y[j] || x[i] < 0) {
          decex = false;
          break;
        }
      }
      if (!decex) break;
    }
    if (decex) {
      int ans1 = 0;
      for (int i = 0; i < n; ++i) ans1 += x[i];
      for (int i = 0; i < m; ++i) ans1 += y[i];
      if (ans1 < ans) {
        ans = ans1;
        myx = x;
        myy = y;
      }
    }
  }
  cout << ((ans == INT_MAX) ? -1 : ans) << endl;
  if (ans != INT_MAX) {
    for (int i = 0; i < n; ++i) {
      assert(cerr << myx[i] << " ");
      for (int j = 0; j < myx[i]; ++j) {
        cout << "row " << i + 1 << endl;
      }
    }
    assert(cerr << endl);
    for (int i = 0; i < m; ++i) {
      assert(cerr << myy[i] << " ");
      for (int j = 0; j < myy[i]; ++j) {
        cout << "col " << i + 1 << endl;
      }
    }
    assert(cerr << endl);
  }
  return 0;
}
