#include <bits/stdc++.h>
using namespace std;
long long g[105][105];
vector<pair<long long, long long> > r, c;
void fail() {
  cout << "-1" << endl;
  exit(0);
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long mn = (long long)(1e18 + 3);
  long long ans = 0;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      cin >> g[i][j];
      mn = min(mn, g[i][j]);
    }
  ans += mn * min(n, m);
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) g[i][j] -= mn;
  for (long long i = 0; i < n; i++) {
    long long mnR = (long long)(1e18 + 3);
    for (long long j = 0; j < m; j++) {
      mnR = min(mnR, g[i][j]);
    }
    if (mnR > 0) r.push_back({i, mnR});
    ans += mnR;
    for (long long j = 0; j < m; j++) {
      g[i][j] -= mnR;
    }
  }
  for (long long j = 0; j < m; j++) {
    long long mnC = (long long)(1e18 + 3);
    for (long long i = 0; i < n; i++) {
      mnC = min(mnC, g[i][j]);
    }
    if (mnC > 0) c.push_back({j, mnC});
    ans += mnC;
    for (long long i = 0; i < n; i++) {
      g[i][j] -= mnC;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (g[i][j]) fail();
    }
  }
  cout << ans << endl;
  for (long long i = 0; i < mn; i++) {
    if (n < m)
      for (long long j = 0; j < n; j++) cout << "row " << j + 1 << endl;
    else
      for (long long j = 0; j < m; j++) cout << "col " << j + 1 << endl;
  }
  for (long long i = 0; i < r.size(); i++) {
    for (long long j = 0; j < r[i].second; j++)
      cout << "row " << r[i].first + 1 << endl;
  }
  for (long long i = 0; i < c.size(); i++) {
    for (long long j = 0; j < c[i].second; j++)
      cout << "col " << c[i].first + 1 << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
