#include <bits/stdc++.h>
using namespace std;
struct item {
  int mi, x, y;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n, vector<int>(m)), g2(n, vector<int>(m));
  vector<pair<string, int>> ans;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> g[i][j];
      g2[i][j] = g[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    int mi = *min_element(g[i].begin(), g[i].end());
    for (int j = 0; j < m; ++j) {
      g[i][j] -= mi;
    }
    while (mi--) ans.emplace_back("row", i + 1);
  }
  for (int j = 0; j < m; ++j) {
    int mi = 1e6;
    for (int i = 0; i < n; ++i) {
      mi = min(mi, g[i][j]);
    }
    for (int i = 0; i < n; ++i) {
      g[i][j] -= mi;
    }
    while (mi--) ans.emplace_back("col", j + 1);
  }
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (g[i][j]) {
        ok = false;
        break;
      }
    }
    if (!ok) break;
  }
  if (!ok) {
    cout << "-1";
    return 0;
  }
  vector<pair<string, int>> ans2;
  for (int j = 0; j < m; ++j) {
    int mi = 1e6;
    for (int i = 0; i < n; ++i) {
      mi = min(mi, g2[i][j]);
    }
    for (int i = 0; i < n; ++i) {
      g2[i][j] -= mi;
    }
    while (mi--) ans2.emplace_back("col", j + 1);
  }
  for (int i = 0; i < n; ++i) {
    int mi = *min_element(g2[i].begin(), g2[i].end());
    for (int j = 0; j < m; ++j) {
      g2[i][j] -= mi;
    }
    while (mi--) ans2.emplace_back("row", i + 1);
  }
  if (ans.size() < ans2.size()) {
    cout << ans.size() << "\n";
    for (const auto& p : ans) cout << p.first << ' ' << p.second << "\n";
  } else {
    cout << ans2.size() << "\n";
    for (const auto& p : ans2) cout << p.first << ' ' << p.second << "\n";
  }
  return 0;
}
