#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int v[MAXN][MAXN];
vector<pair<int, int> > ans;
int n, m;
void cols() {
  for (int i = 0; i < (m); ++i) {
    int minv = 0x3f3f3f3f;
    for (int j = 0; j < (n); ++j) minv = min(minv, v[j][i]);
    for (int j = 0; j < (n); ++j) v[j][i] -= minv;
    for (int qtd = 0; qtd < (minv); ++qtd) ans.push_back(make_pair(0, i + 1));
  }
}
void rows() {
  for (int i = 0; i < (n); ++i) {
    int minv = 0x3f3f3f3f;
    for (int j = 0; j < (m); ++j) minv = min(minv, v[i][j]);
    for (int j = 0; j < (m); ++j) v[i][j] -= minv;
    for (int qtd = 0; qtd < (minv); ++qtd) ans.push_back(make_pair(1, i + 1));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j) cin >> v[i][j];
  if (n > m) {
    cols();
    rows();
  } else {
    rows();
    cols();
  }
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j)
      if (v[i][j]) {
        cout << -1 << endl;
        exit(0);
      }
  cout << (int)((ans).size()) << endl;
  for (auto p : ans)
    cout << (p.first ? "row" : "col") << " " << p.second << endl;
  return 0;
}
