#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
const int maxn = 100 + 10;
int n, m;
int g[maxn][maxn];
vector<pair<int, int> > ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i)
    for (int j = 0, j__n = (int)(m); j < j__n; ++j) cin >> g[i][j];
  int mn = 999;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i)
    for (int j = 0, j__n = (int)(m); j < j__n; ++j) smin(mn, g[i][j]);
  if (n < m)
    for (int x = 0, x__n = (int)(mn); x < x__n; ++x)
      for (int i = 0, i__n = (int)(n); i < i__n; ++i)
        ans.push_back(pair<int, int>(0, i));
  else
    for (int x = 0, x__n = (int)(mn); x < x__n; ++x)
      for (int j = 0, j__n = (int)(m); j < j__n; ++j)
        ans.push_back(pair<int, int>(1, j));
  for (int i = 0, i__n = (int)(n); i < i__n; ++i)
    for (int j = 0, j__n = (int)(m); j < j__n; ++j) g[i][j] -= mn;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i) {
    mn = 999;
    for (int j = 0, j__n = (int)(m); j < j__n; ++j) smin(mn, g[i][j]);
    for (int x = 0, x__n = (int)(mn); x < x__n; ++x)
      ans.push_back(pair<int, int>(0, i));
    for (int j = 0, j__n = (int)(m); j < j__n; ++j) g[i][j] -= mn;
  }
  for (int j = 0, j__n = (int)(m); j < j__n; ++j) {
    mn = 999;
    for (int i = 0, i__n = (int)(n); i < i__n; ++i) smin(mn, g[i][j]);
    for (int x = 0, x__n = (int)(mn); x < x__n; ++x)
      ans.push_back(pair<int, int>(1, j));
    for (int i = 0, i__n = (int)(n); i < i__n; ++i) g[i][j] -= mn;
  }
  bool ok = true;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i)
    for (int j = 0, j__n = (int)(m); j < j__n; ++j)
      if (g[i][j]) ok = false;
  if (ok) {
    cout << (int((ans).size())) << endl;
    for (pair<int, int> p : ans)
      cout << (p.first ? "col" : "row") << ' ' << p.second + 1 << endl;
  } else
    cout << -1 << endl;
  return 0;
}
