#include <bits/stdc++.h>
using namespace std;
int grid[101][101], row[101], col[101], bestrow[101], bestcol[101], N, M;
int main() {
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      cin >> grid[i][j];
    }
  }
  int current_best = 1000000007, current_moves;
  for (row[1] = 0; row[1] <= 500; row[1]++) {
    bool possible = true;
    current_moves = row[1];
    for (int i = 1; i <= M; i++) {
      col[i] = grid[1][i] - row[1];
      current_moves += col[i];
      if (col[i] < 0) possible = false;
    }
    for (int i = 2; i <= N; i++) {
      row[i] = grid[i][1] - col[1];
      current_moves += row[i];
      if (row[i] < 0) possible = false;
    }
    for (int i = 1; i <= N; i++) {
      for (int j = 1; j <= M; j++) {
        if (row[i] + col[j] != grid[i][j]) {
          possible = false;
        }
      }
    }
    if (!possible) {
      continue;
    }
    if (current_best > current_moves) {
      current_best = current_moves;
      memcpy(bestrow, row, sizeof(row));
      memcpy(bestcol, col, sizeof(col));
    }
  }
  if (current_best == 1000000007) {
    cout << "-1";
  } else {
    cout << current_best << '\n';
    for (int i = 1; i <= N; i++) {
      while (bestrow[i]--) {
        cout << "row " << i << endl;
      }
    }
    for (int i = 1; i <= M; i++) {
      while (bestcol[i]--) {
        cout << "col " << i << endl;
      }
    }
  }
  return 0;
}
