#include <bits/stdc++.h>
using namespace std;
int grid[101][101];
int grid_test[101][101];
int row[101];
int col[101];
int row_sol[101];
int col_sol[101];
int main() {
  int n, m;
  int max = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> grid[i][j];
      if (grid[i][j] > max) max = grid[i][j];
    }
  bool found = false;
  long long min_moves = 100000000000;
  for (int k = 0; k <= max; k++) {
    for (int i = 0; i < n; i++) row[i] = 0;
    for (int j = 0; j < m; j++) col[j] = 0;
    long long moves = k;
    bool gotoMainLoop = false;
    row[0] += k;
    for (int i = 0; i < n && !gotoMainLoop; i++) {
      for (int j = 0; j < m && !gotoMainLoop; j++) {
        grid_test[i][j] = 0;
        if (i == 0) {
          if (k > grid[i][j]) {
            gotoMainLoop = true;
            break;
          }
          grid_test[i][j] += k;
        }
      }
    }
    for (int j = 0; j < m && !gotoMainLoop; j++) {
      int rem;
      if (grid_test[0][j] < grid[0][j]) {
        rem = grid[0][j] - grid_test[0][j];
        col[j] += rem;
        moves += rem;
        for (int i = 0; i < n; i++) {
          if (grid_test[i][j] + rem <= grid[i][j])
            grid_test[i][j] += rem;
          else {
            gotoMainLoop = true;
            break;
          }
        }
      }
    }
    for (int i = 0; i < n && !gotoMainLoop; i++) {
      int rem;
      rem = grid[i][0] - grid_test[i][0];
      row[i] += rem;
      moves += rem;
      for (int j = 0; j < m && !gotoMainLoop; j++) {
        if (grid_test[i][j] + rem != grid[i][j]) {
          gotoMainLoop = true;
          break;
        }
      }
    }
    if (!gotoMainLoop and moves < min_moves) {
      min_moves = moves;
      for (int i = 0; i < n; i++) row_sol[i] = row[i];
      for (int j = 0; j < m; j++) col_sol[j] = col[j];
    }
  }
  if (min_moves == 100000000000)
    cout << -1 << endl;
  else {
    cout << min_moves << endl;
    for (int i = 0; i < n; i++)
      for (int t = 0; t < row_sol[i]; t++) cout << "row " << i + 1 << endl;
    for (int j = 0; j < m; j++)
      for (int t = 0; t < col_sol[j]; t++) cout << "col " << j + 1 << endl;
  }
  return 0;
}
