#include <bits/stdc++.h>
inline int pidorand() { return ((rand() & 32767) << 15) | (rand() & 32767); }
using namespace std;
inline int nxt() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  int n = nxt(), m = nxt();
  vector<vector<int>> a(n, vector<int>(m, 0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      a[i][j] = nxt();
    }
  }
  vector<int> r(n), c(m);
  for (int i = 0; i < n; ++i) {
    r[i] = a[i][0];
  }
  for (int j = 0; j < m; ++j) {
    c[j] = a[0][j] - r[0];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (a[i][j] != r[i] + c[j]) {
        puts("-1");
        return 0;
      }
    }
  }
  int mr = *min_element((r).begin(), (r).end());
  int mc = *min_element((c).begin(), (c).end());
  int offset = 0;
  if (n <= m) {
    offset = mc;
  } else {
    offset = -mr;
  }
  for (int& x : r) {
    x += offset;
  }
  for (int& x : c) {
    x -= offset;
  }
  for (int x : r) {
    if (x < 0) {
      puts("-1");
      return 0;
    }
  }
  for (int x : c) {
    if (x < 0) {
      puts("-1");
      return 0;
    }
  }
  cout << accumulate((r).begin(), (r).end(), 0) +
              accumulate((c).begin(), (c).end(), 0)
       << "\n";
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < r[i]; ++j) {
      printf("row %d\n", i + 1);
    }
  }
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < c[i]; ++j) {
      printf("col %d\n", i + 1);
    }
  }
  return 0;
}
