#include <bits/stdc++.h>
using namespace std;
const int N = 5 * 1e5 + 1997, INF = 10e8, M = 150;
long long MOD = 100 * 100 + 7;
int n, m, A[500][500];
vector<string> ans;
vector<int> ans2;
bool isR(int p) {
  for (int i = 0; i < m; i++)
    if (A[p][i] <= 0) return 0;
  return 1;
}
bool isC(int p) {
  for (int i = 0; i < n; i++)
    if (A[i][p] <= 0) return 0;
  return 1;
}
bool isF() {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (A[i][j] != 0) return 0;
  return 1;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> A[i][j];
  if (n > m) {
    bool Do = 1;
    while (Do) {
      Do = 0;
      for (int i = 0; i < m; i++)
        if (isC(i)) {
          for (int j = 0; j < n; j++) A[j][i]--;
          ans.push_back("col ");
          ans2.push_back(i);
          Do = 1;
        }
    }
    Do = 1;
    while (Do) {
      Do = 0;
      for (int i = 0; i < n; i++)
        if (isR(i)) {
          for (int j = 0; j < m; j++) A[i][j]--;
          ans.push_back("row ");
          ans2.push_back(i);
          Do = 1;
        }
    }
  } else {
    bool Do = 1;
    while (Do) {
      Do = 0;
      for (int i = 0; i < n; i++)
        if (isR(i)) {
          for (int j = 0; j < m; j++) A[i][j]--;
          ans.push_back("row ");
          ans2.push_back(i);
          Do = 1;
        }
    }
    Do = 1;
    while (Do) {
      Do = 0;
      for (int i = 0; i < m; i++)
        if (isC(i)) {
          for (int j = 0; j < n; j++) A[j][i]--;
          ans.push_back("col ");
          ans2.push_back(i);
          Do = 1;
        }
    }
  }
  if (!isF()) {
    cout << -1;
    return 0;
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ans2[i] + 1 << endl;
  return 0;
}
