#include <bits/stdc++.h>
using namespace std;
int a[1000][1000], b[1000][1000];
int main() {
  int i, j, n, m, ans = 0, p = 0;
  cin >> n >> m;
  vector<pair<int, int> > r, c;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      cin >> a[i][j];
      b[i][j] = a[i][j];
    }
  if (m < n) {
    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++) a[j][i] = b[i][j];
    int temp = m;
    m = n;
    n = temp;
    p = 1;
  }
  for (i = 1; i <= n; i++) {
    int minn = INT_MAX;
    for (j = 1; j <= m; j++)
      if (a[i][j] < minn) minn = a[i][j];
    if (minn != 0) {
      for (j = 1; j <= m; j++) a[i][j] -= minn;
      r.push_back({i, minn});
      ans += minn;
    }
  }
  for (i = 1; i <= m; i++) {
    int minn = INT_MAX;
    for (j = 1; j <= n; j++)
      if (a[j][i] < minn) minn = a[j][i];
    if (minn != 0) {
      for (j = 1; j <= n; j++) a[j][i] -= minn;
      c.push_back({i, minn});
      ans += minn;
    }
  }
  string row = "row ", col = "col ";
  if (p) {
    row = "col ";
    col = "row ";
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (a[i][j]) {
        cout << -1;
        return 0;
      }
  cout << ans << endl;
  for (i = 0; i < r.size(); i++) {
    for (j = 0; j < r[i].second; j++) cout << row << r[i].first << endl;
  }
  for (i = 0; i < c.size(); i++) {
    for (j = 0; j < c[i].second; j++) cout << col << c[i].first << endl;
  }
  return 0;
}
