#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
const long long INF = 1 << 60;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> rows, columns;
  vector<vector<int> > v(n, vector<int>(m));
  int mn = inf;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> v[i][j];
  if (n < m) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) mn = min(mn, v[i][j]);
      for (int j = 0; j < m; ++j) v[i][j] -= mn;
      for (int j = 0; j < mn; ++j) rows.push_back(i + 1);
      mn = inf;
    }
    for (int j = 0; j < m; ++j) {
      for (int i = 0; i < n; ++i) mn = min(mn, v[i][j]);
      for (int i = 0; i < n; ++i) v[i][j] -= mn;
      for (int i = 0; i < mn; ++i) columns.push_back(j + 1);
      mn = inf;
    }
  } else {
    for (int j = 0; j < m; ++j) {
      for (int i = 0; i < n; ++i) mn = min(mn, v[i][j]);
      for (int i = 0; i < n; ++i) v[i][j] -= mn;
      for (int i = 0; i < mn; ++i) columns.push_back(j + 1);
      mn = inf;
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) mn = min(mn, v[i][j]);
      for (int j = 0; j < m; ++j) v[i][j] -= mn;
      for (int j = 0; j < mn; ++j) rows.push_back(i + 1);
      mn = inf;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (v[i][j]) {
        cout << -1;
        return 0;
      }
    }
  }
  cout << rows.size() + columns.size() << "\n";
  for (int r : rows) cout << "row " << r << "\n";
  for (int c : columns) cout << "col " << c << "\n";
}
