#include <bits/stdc++.h>
using namespace std;
int a[104][104], row[105], col[105];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  int k;
  int mini = (1000 * 1000 * 1000 + 5), sumi, flag;
  int remem = -1;
  for (k = 0; k < 502; k++) {
    flag = 0;
    sumi = 0;
    col[0] = k;
    for (i = 0; i < n; i++) {
      row[i] = a[i][0] - col[0];
    }
    for (i = 0; i < m; i++) {
      col[i] = a[0][i] - row[0];
    }
    for (i = 0; i < n; i++) {
      if (row[i] < 0) {
        flag = 1;
      }
      sumi += row[i];
    }
    for (j = 0; j < m; j++) {
      if (col[j] < 0) {
        flag = 1;
      }
      sumi += col[j];
    }
    if (flag) continue;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (a[i][j] != row[i] + col[j]) {
          flag = 1;
          break;
        }
      }
      if (flag) {
        break;
      }
    }
    if (flag) continue;
    if (mini > sumi) {
      mini = sumi;
      remem = k;
    }
  }
  if (mini == (1000 * 1000 * 1000 + 5)) {
    cout << -1 << endl;
    return 0;
  }
  sumi = 0;
  col[0] = remem;
  for (i = 0; i < n; i++) {
    row[i] = a[i][0] - col[0];
  }
  for (i = 0; i < m; i++) {
    col[i] = a[0][i] - row[0];
  }
  for (i = 0; i < n; i++) {
    sumi += row[i];
  }
  for (j = 0; j < m; j++) {
    sumi += col[j];
  }
  cout << sumi << endl;
  for (i = 0; i < n; i++) {
    for (j = 0; j < row[i]; j++) {
      cout << "row " << i + 1 << endl;
    }
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < col[i]; j++) {
      cout << "col " << i + 1 << endl;
    }
  }
  return 0;
}
