#include <bits/stdc++.h>
using namespace std;
int toNumber(string s) {
  int Number;
  if (!(istringstream(s) >> Number)) Number = 0;
  return Number;
}
string toString(int number) {
  ostringstream ostr;
  ostr << number;
  return ostr.str();
}
long long ele(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    return ele(a * a, b / 2);
  } else {
    return a * ele(a * a, b / 2);
  }
}
long long mcd(long long a, long long b) {
  if (a == 0) return b;
  return mcd(b % a, a);
}
double d_abs(long a, long b) {
  if (a > b) {
    return a - b;
  }
  return b - a;
}
void solve() {
  int a, b, n;
  vector<long long> v;
  int k, q;
  int m;
  cin >> n >> m;
  int grid[n][m];
  int ma[n];
  set<int> rows;
  int todas = 600;
  for (int i = 0; i < (int)(n); i++) {
    int maxi = 600;
    for (int j = 0; j < (int)(m); j++) {
      cin >> grid[i][j];
      maxi = min(maxi, grid[i][j]);
    }
    ma[i] = maxi;
    for (int j = 0; j < (int)(m); j++) {
      grid[i][j] -= maxi;
    }
    todas = min(todas, maxi);
  }
  set<pair<int, int> > cols;
  bool pase[m];
  int co[m];
  int todascol = 600;
  for (int i = 0; i < (int)(m); i++) pase[i] = false;
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      if (grid[i][j]) {
        pase[j] = true;
        set<int> se;
        for (int q = 0; q < (int)(n); q++) {
          se.insert(grid[q][j]);
        }
        if (se.size() > 1) {
          cout << -1 << endl;
          return;
        } else {
          co[j] = *se.begin();
        }
        todascol = min(todascol, *se.begin());
      } else {
        todascol = 0;
        co[j] = 0;
      }
    }
  }
  if (todas) {
    if (n > m) {
      for (int i = 0; i < (int)(n); i++) ma[i] -= todas;
      for (int j = 0; j < (int)(m); j++) co[j] += todas;
    }
  }
  if (todascol) {
    if (m > n) {
      for (int i = 0; i < (int)(n); i++) ma[i] += todascol;
      for (int j = 0; j < (int)(m); j++) co[j] -= todascol;
    }
  }
  int res = 0;
  for (int i = 0; i < (int)(n); i++) {
    res += ma[i];
  }
  for (int i = 0; i < (int)(m); i++) {
    res += co[i];
  }
  cout << res << endl;
  for (int i = 0; i < (int)(n); i++) {
    for (int can = 0; can < (int)(ma[i]); can++)
      cout << "row " << i + 1 << endl;
  }
  for (int i = 0; i < (int)(m); i++) {
    for (int can = 0; can < (int)(co[i]); can++)
      cout << "col " << i + 1 << endl;
  }
}
int main() {
  int T;
  T = 1;
  while (T--) {
    solve();
  }
}
