#include <bits/stdc++.h>
using namespace std;
const int maxn = 505 * 1001;
const int Base = 199;
int n, m, g[110][110], tr[110], tc[110], ans;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> g[i][j];
  if (n <= m) {
    for (int i = 1; i <= n; i++) {
      tr[i] = g[i][1];
      for (int j = 1; j <= m; j++) tr[i] = min(tr[i], g[i][j]);
    }
    for (int i = 1; i <= n; i++) {
      ans += tr[i];
      for (int j = 1; j <= m; j++) g[i][j] -= tr[i];
    }
    for (int j = 1; j <= m; j++) {
      tc[j] = g[1][j];
      for (int i = 1; i <= n; i++) tc[j] = min(tc[j], g[i][j]);
    }
    for (int j = 1; j <= m; j++) {
      ans += tc[j];
      for (int i = 1; i <= n; i++) g[i][j] -= tc[j];
    }
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++)
        if (g[i][j]) return cout << "-1", 0;
    cout << ans << "\n";
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= tr[i]; j++) cout << "row " << i << "\n";
    for (int j = 1; j <= m; j++)
      for (int i = 1; i <= tc[j]; i++) cout << "col " << j << "\n";
  } else {
    for (int j = 1; j <= m; j++) {
      tc[j] = g[1][j];
      for (int i = 1; i <= n; i++) tc[j] = min(tc[j], g[i][j]);
    }
    for (int j = 1; j <= m; j++) {
      ans += tc[j];
      for (int i = 1; i <= n; i++) g[i][j] -= tc[j];
    }
    for (int i = 1; i <= n; i++) {
      tr[i] = g[i][1];
      for (int j = 1; j <= m; j++) tr[i] = min(tr[i], g[i][j]);
    }
    for (int i = 1; i <= n; i++) {
      ans += tr[i];
      for (int j = 1; j <= m; j++) g[i][j] -= tr[i];
    }
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++)
        if (g[i][j]) return cout << "-1", 0;
    cout << ans << "\n";
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= tr[i]; j++) cout << "row " << i << "\n";
    for (int j = 1; j <= m; j++)
      for (int i = 1; i <= tc[j]; i++) cout << "col " << j << "\n";
  }
  return 0;
}
