#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int n, m, k, a[105][105], r[105], c[105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  if (n <= m) {
    for (int i = 0; i < n; i++) {
      r[i] = 0x3f3f3f3f;
      for (int j = 0; j < m; j++) {
        r[i] = min(r[i], a[i][j]);
      }
      k += r[i];
    }
    for (int j = 0; j < m; j++) {
      for (int i = 0; i < n; i++) {
        a[i][j] -= r[i];
        if (i && a[i][j] != a[i - 1][j]) {
          cout << "-1\n";
          return 0;
        }
      }
      c[j] = a[0][j];
      k += c[j];
    }
    cout << k << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < r[i]; j++) {
        cout << "row " << i + 1 << endl;
      }
    }
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < c[i]; j++) {
        cout << "col " << i + 1 << endl;
      }
    }
  } else {
    for (int j = 0; j < m; j++) {
      c[j] = 0x3f3f3f3f;
      for (int i = 0; i < n; i++) {
        c[j] = min(c[j], a[i][j]);
      }
      k += c[j];
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] -= c[j];
        if (j && a[i][j] != a[i][j - 1]) {
          cout << "-1\n";
          return 0;
        }
      }
      r[i] = a[i][0];
      k += r[i];
    }
    cout << k << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < r[i]; j++) {
        cout << "row " << i + 1 << endl;
      }
    }
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < c[i]; j++) {
        cout << "col " << i + 1 << endl;
      }
    }
  }
  return 0;
}
