#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  int a[200][200];
  cin >> m >> n;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  int r[200], c[200];
  for (int i = 0; i < m; i++) r[i] = -1;
  for (int i = 0; i < n; i++) c[i] = -1;
  int val = a[0][0];
  for (int j = 0; j < n; j++)
    if (a[0][j] < val) val = a[0][j];
  r[0] = val;
  for (int j = 0; j < n; j++) c[j] = a[0][j] - r[0];
  for (int i = 1; i < m; i++) {
    int val = a[i][0];
    for (int j = 0; j < n; j++)
      if (a[i][j] < val) val = a[i][j];
    r[i] = val;
    for (int j = 0; j < n; j++) {
      if (r[i] + c[j] != a[i][j]) {
        cout << -1;
        return 0;
      }
    }
  }
  if (m < n) {
    int allc = c[0];
    for (int j = 0; j < n; j++)
      if (c[j] < allc) allc = c[j];
    for (int j = 0; j < n; j++) c[j] -= allc;
    for (int i = 0; i < m; i++) r[i] += allc;
  } else {
    int allr = r[0];
    for (int i = 0; i < m; i++)
      if (r[i] < allr) allr = r[i];
    for (int i = 0; i < m; i++) r[i] -= allr;
    for (int j = 0; j < n; j++) c[j] += allr;
  }
  int total = 0;
  for (int i = 0; i < m; i++) total += r[i];
  for (int j = 0; j < n; j++) total += c[j];
  cout << total << endl;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < r[i]; j++) cout << "row " << i + 1 << endl;
  }
  for (int j = 0; j < n; j++) {
    for (int i = 0; i < c[j]; i++) cout << "col " << j + 1 << endl;
  }
}
