#include <bits/stdc++.h>
using namespace std;
const int MAXN = 150;
vector<pair<char, int> > ans, ans2;
int table[MAXN][MAXN], table2[MAXN][MAXN];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> table[i][j];
      table2[i][j] = table[i][j];
    }
  for (int i = 0; i < n; i++) {
    int mini = table[i][0];
    for (int j = 1; j < m; j++) mini = min(mini, table[i][j]);
    for (int j = 0; j < mini; j++) ans.push_back({'r', i + 1});
    for (int j = 0; j < m; j++) table[i][j] -= mini;
  }
  for (int i = 0; i < m; i++) {
    int up = table[0][i];
    for (int j = 1; j < n; j++) {
      if (table[j][i] != up) {
        cout << -1;
        return 0;
      }
    }
    for (int j = 0; j < up; j++) ans.push_back({'c', i + 1});
  }
  for (int i = 0; i < m; i++) {
    int mini = table2[0][i];
    for (int j = 1; j < n; j++) mini = min(mini, table2[j][i]);
    for (int j = 0; j < mini; j++) ans2.push_back({'c', i + 1});
    for (int j = 0; j < n; j++) table2[j][i] -= mini;
  }
  for (int i = 0; i < n; i++) {
    int up = table2[i][0];
    for (int j = 1; j < m; j++) {
      if (table2[i][j] != up) {
        cout << -1;
        return 0;
      }
    }
    for (int j = 0; j < up; j++) ans2.push_back({'r', i + 1});
  }
  if (ans.size() < ans2.size()) {
    cout << ans.size() << endl;
    for (auto j : ans) {
      if (j.first == 'r')
        cout << "row " << j.second << endl;
      else
        cout << "col " << j.second << endl;
    }
    return 0;
  } else {
    cout << ans2.size() << endl;
    for (auto j : ans2) {
      if (j.first == 'r')
        cout << "row " << j.second << endl;
      else
        cout << "col " << j.second << endl;
    }
    return 0;
  }
}
