#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int mod = (ll)1e9 + 7;
const int INF = 1e9 + 1;
const int N = 2e5 + 100;
const double eps = 1e-3;
template <typename XPAX>
void ckma(XPAX &x, XPAX y) {
  x = (x < y ? y : x);
}
template <typename XPAX>
void ckmi(XPAX &x, XPAX y) {
  x = (x > y ? y : x);
}
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j) cin >> a[i][j];
  auto b = a;
  vector<pair<string, int>> ans;
  vector<pair<string, int>> ans2;
  for (int i = 0; i < (n); ++i) {
    int x = INF;
    for (int j = 0; j < (m); ++j) {
      ckmi(x, a[i][j]);
    }
    for (int j = 0; j < (m); ++j) a[i][j] -= x;
    while (x--) {
      ans.push_back({"row", i + 1});
    }
  }
  for (int j = 0; j < (m); ++j) {
    int x = INF;
    for (int i = 0; i < (n); ++i) {
      ckmi(x, a[i][j]);
    }
    for (int i = 0; i < (n); ++i) a[i][j] -= x;
    while (x--) {
      ans.push_back({"col", j + 1});
    }
  }
  int ok = 2;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j) {
      if (a[i][j]) {
        cout << -1 << '\n';
        return;
      }
    }
  for (int j = 0; j < (m); ++j) {
    int x = INF;
    for (int i = 0; i < (n); ++i) {
      ckmi(x, b[i][j]);
    }
    for (int i = 0; i < (n); ++i) b[i][j] -= x;
    while (x--) {
      ans2.push_back({"col", j + 1});
    }
  }
  for (int i = 0; i < (n); ++i) {
    int x = INF;
    for (int j = 0; j < (m); ++j) {
      ckmi(x, b[i][j]);
    }
    for (int j = 0; j < (m); ++j) b[i][j] -= x;
    while (x--) {
      ans2.push_back({"row", i + 1});
    }
  }
  if (ans2.size() < ans.size()) swap(ans, ans2);
  cout << ans.size() << '\n';
  for (auto c : ans) {
    cout << c.first << ' ' << c.second << '\n';
  }
}
void test_case() {
  int t;
  cin >> t;
  for (int p = 0; p < (t); ++p) {
    solve();
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
}
