#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 0x3c3c3c3c;
const long long infl = 0x3c3c3c3c3c3c3c3c;
int N, M;
int pane[103][103];
vector<int> row, col;
void checkRow() {
  for (int i = 0; i < N; i++) {
    int minn = 501;
    for (int j = 0; j < M; j++) {
      minn = min(minn, pane[i][j]);
    }
    for (int j = 0; j < M; j++) pane[i][j] -= minn;
    for (int k = 0; k < minn; k++) row.push_back(i + 1);
  }
}
void checkCol() {
  for (int j = 0; j < M; j++) {
    int minn = 501;
    for (int i = 0; i < N; i++) {
      minn = min(minn, pane[i][j]);
    }
    for (int i = 0; i < N; i++) pane[i][j] -= minn;
    for (int k = 0; k < minn; k++) col.push_back(j + 1);
  }
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++) cin >> pane[i][j];
  if (N <= M) {
    checkRow();
    checkCol();
  } else {
    checkCol();
    checkRow();
  }
  bool ok = true;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (pane[i][j]) ok = false;
    }
  }
  if (!ok) {
    cout << -1;
    return 0;
  }
  cout << row.size() + col.size() << endl;
  for (int i = 0; i < row.size(); i++) cout << "row " << row[i] << endl;
  for (int i = 0; i < col.size(); i++) cout << "col " << col[i] << endl;
  return 0;
}
