#include <bits/stdc++.h>
using namespace std;
int n, m, a[110][110], b[110][110];
vector<int> r, c, r2, c2;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j], b[i][j] = a[i][j];
  for (int i = 0; i < n; i++) {
    int mn = 987654321;
    for (int j = 0; j < m; j++) mn = min(mn, a[i][j]);
    for (int j = 0; j < m; j++) a[i][j] -= mn;
    for (int j = 0; j < mn; j++) r.push_back(i + 1);
  }
  for (int i = 0; i < m; i++) {
    int v = a[0][i];
    for (int j = 1; j < n; j++)
      if (a[j][i] != v) return cout << -1, 0;
    for (int j = 0; j < v; j++) c.push_back(i + 1);
  }
  for (int i = 0; i < m; i++) {
    int mn = 987654321;
    for (int j = 0; j < n; j++) mn = min(mn, b[j][i]);
    for (int j = 0; j < n; j++) b[j][i] -= mn;
    for (int j = 0; j < mn; j++) r2.push_back(i + 1);
  }
  for (int i = 0; i < n; i++) {
    int v = b[i][0];
    for (int j = 1; j < m; j++)
      if (b[i][j] != v) return cout << -1, 0;
    for (int j = 0; j < v; j++) c2.push_back(i + 1);
  }
  if (r.size() + c.size() < r2.size() + c2.size()) {
    cout << r.size() + c.size() << endl;
    for (auto v : r) cout << "row " << v << endl;
    for (auto v : c) cout << "col " << v << endl;
    return 0;
  }
  cout << r2.size() + c2.size() << endl;
  for (auto v : r2) cout << "col " << v << endl;
  for (auto v : c2) cout << "row " << v << endl;
  return 0;
}
