#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T>& operator--(vector<T>& v) {
  for (auto& i : v) --i;
  return v;
}
template <typename T>
vector<T>& operator++(vector<T>& v) {
  for (auto& i : v) ++i;
  return v;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& i : v) os << i << ' ';
  return os;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <typename T, typename U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <typename T, typename U>
void umin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void umax(T& a, U b) {
  if (a < b) a = b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> v(n, vector<int>(m));
  cin >> v;
  int maxv = (*min_element((v[0]).begin(), (v[0]).end()));
  int ans = 1e9;
  vector<pair<string, pair<int, int>>> best;
  for (int v0 = 0; v0 <= maxv; ++v0) {
    vector<pair<string, pair<int, int>>> curpath;
    int cur = 0;
    auto u = v;
    bool ok = true;
    curpath.emplace_back("row", make_pair(1, v0));
    cur += abs(v0);
    for (int i = 0; i < m; ++i) {
      u[0][i] -= v0;
    }
    for (int i = 0; i < m; ++i) {
      int k = u[0][i];
      if (k < 0) ok = false;
      curpath.emplace_back("col", make_pair(i + 1, k));
      cur += abs(k);
      for (int j = 0; j < n; ++j) {
        u[j][i] -= k;
      }
    }
    if (v0 == 2) {
      42;
      ;
      42;
      ;
    }
    for (int i = 1; i < n; ++i) {
      int k = u[i][0];
      if (k < 0) ok = false;
      curpath.emplace_back("row", make_pair(i + 1, k));
      cur += abs(k);
      for (int j = 0; j < m; ++j) u[i][j] -= k;
    }
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j)
        if (u[i][j] != 0) ok = false;
    if (ok && ans > cur) {
      ans = min(ans, cur);
      best = curpath;
    }
  }
  if (ans == 1e9) ans = -1;
  cout << ans << '\n';
  for (auto [s, uv] : best) {
    for (int i = 0; i < uv.second; ++i) {
      cout << s << ' ' << uv.first << '\n';
    }
  }
  return 0;
}
