#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k, l, coun = 0, coun1 = 0;
  cin >> n >> m;
  int a[n][m], b[n], c[m], d[n], f[m], e[n][m];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
      e[i][j] = a[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    int ma = 1000;
    for (j = 0; j < m; j++) {
      ma = min(a[i][j], ma);
    }
    b[i] = ma;
    coun += ma;
    for (j = 0; j < m; j++) {
      a[i][j] -= ma;
    }
  }
  for (j = 0; j < m; j++) {
    int ma = 1000;
    for (i = 0; i < n; i++) {
      ma = min(ma, a[i][j]);
    }
    c[j] = ma;
    coun += ma;
    for (i = 0; i < n; i++) {
      a[i][j] -= ma;
    }
  }
  int flag = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] > 0) {
        flag = 1;
        break;
      }
    }
  }
  if (flag) {
    cout << -1 << endl;
  } else {
    for (j = 0; j < m; j++) {
      int ma = 1000;
      for (i = 0; i < n; i++) {
        ma = min(ma, e[i][j]);
      }
      f[j] = ma;
      coun1 += ma;
      for (i = 0; i < n; i++) {
        e[i][j] -= ma;
      }
    }
    for (i = 0; i < n; i++) {
      int ma = 1000;
      for (j = 0; j < m; j++) {
        ma = min(e[i][j], ma);
      }
      d[i] = ma;
      coun1 += ma;
      for (j = 0; j < m; j++) {
        e[i][j] -= ma;
      }
    }
    k = min(coun, coun1);
    cout << k << endl;
    if (k == coun) {
      for (i = 0; i < n; i++) {
        if (b[i] > 0) {
          for (j = 0; j < b[i]; j++) {
            cout << "row " << i + 1 << endl;
          }
        }
      }
      for (j = 0; j < m; j++) {
        if (c[j] > 0) {
          for (i = 0; i < c[j]; i++) {
            cout << "col " << j + 1 << endl;
          }
        }
      }
    } else {
      for (i = 0; i < n; i++) {
        if (d[i] > 0) {
          for (j = 0; j < d[i]; j++) {
            cout << "row " << i + 1 << endl;
          }
        }
      }
      for (j = 0; j < m; j++) {
        if (f[j] > 0) {
          for (i = 0; i < f[j]; i++) {
            cout << "col " << j + 1 << endl;
          }
        }
      }
    }
  }
}
