#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void soln();
signed main() {
  int t = 1;
  while (t--) soln();
  return 0;
}
int a[110][110];
void soln() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(m); ++j) cin >> a[i][j];
  int steps = 0;
  queue<tuple<string, int, int>> st;
  bool fail = false;
  if (n < m) {
    for (int i = 0; i < (int)(n); ++i) {
      int mn = 1e9;
      for (int j = 0; j < (int)(m); ++j) {
        mn = min(mn, a[i][j]);
      }
      for (int j = 0; j < (int)(m); ++j) {
        a[i][j] -= mn;
      }
      steps += mn;
      st.push({"row", i, mn});
    }
    for (int j = 0; j < (int)(m); ++j) {
      bool all_same = true;
      for (int i = 0; i < (int)(n); ++i) {
        all_same &= (a[i][j] == a[0][j]);
      }
      if (!all_same) {
        fail = true;
      } else {
        steps += a[0][j];
        st.push({"col", j, a[0][j]});
      }
    }
  } else {
    for (int j = 0; j < (int)(m); ++j) {
      int mn = 1e9;
      for (int i = 0; i < (int)(n); ++i) {
        mn = min(mn, a[i][j]);
      }
      for (int i = 0; i < (int)(n); ++i) {
        a[i][j] -= mn;
      }
      steps += mn;
      st.push({"col", j, mn});
    }
    for (int i = 0; i < (int)(n); ++i) {
      bool all_same = true;
      for (int j = 0; j < (int)(m); ++j) {
        all_same &= (a[i][j] == a[i][0]);
      }
      if (!all_same) {
        fail = true;
      } else {
        steps += a[i][0];
        st.push({"row", i, a[i][0]});
      }
    }
  }
  if (fail) {
    cout << -1 << "\n";
  } else {
    cout << steps << "\n";
    while (!st.empty()) {
      auto [str, idx, tim] = st.front();
      st.pop();
      for (int i = 0; i < (int)(tim); ++i)
        cout << str << " " << idx + 1 << "\n";
    }
  }
}
