#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
const int MOD = 1000000000 + 7;
const int INF = 1000000000 + 5;
const int MAX = 200000;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int g[105][105];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &g[i][j]);
    }
  }
  int minMoves = INF;
  vector<int> pr, pc;
  for (int r0 = 0; r0 <= g[0][0]; r0++) {
    vector<int> c(m);
    bool check = true;
    for (int i = 0; i < m; i++) {
      c[i] = g[0][i] - r0;
      if (c[i] < 0) {
        check = false;
        break;
      }
    }
    if (check) {
      vector<int> r(n);
      for (int i = 0; i < n; i++) {
        r[i] = g[i][0] - c[0];
        if (r[i] < 0) {
          check = false;
          break;
        }
      }
      if (check) {
        int moves = 0;
        for (int i = 0; i < n; i++) moves += r[i];
        for (int i = 0; i < m; i++) moves += c[i];
        bool isTrue = true;
        {
          for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
              if (r[i] + c[j] != g[i][j]) {
                isTrue = false;
                break;
              }
            }
            if (!isTrue) break;
          }
        }
        if (isTrue && moves < minMoves) {
          pr = r;
          pc = c;
          minMoves = moves;
        }
      }
    }
  }
  if (minMoves == INF)
    printf("-1\n");
  else {
    printf("%d\n", minMoves);
    for (int i = 0; i < n; i++) {
      while (pr[i]--) printf("row %d\n", i + 1);
    }
    for (int i = 0; i < m; i++) {
      while (pc[i]--) printf("col %d\n", i + 1);
    }
  }
}
