#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int g[501][501], a[501][501];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> g[i][j];
      a[i][j] = g[i][j];
    }
  }
  vector<string> ans1, ans2;
  for (int i = 0; i < n; i++) {
    int mn = INT_MAX;
    for (int j = 0; j < m; j++) {
      mn = min(mn, g[i][j]);
    }
    for (int j = 0; j < m; j++) {
      g[i][j] -= mn;
    }
    for (int j = 0; j < mn; j++) {
      ans1.push_back("row " + to_string(i + 1));
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < g[0][i]; j++) ans1.push_back("col " + to_string(i + 1));
    int x = g[0][i];
    for (int j = 0; j < n; j++) {
      g[j][i] -= x;
      if (g[j][i] != 0) {
        cout << -1;
        return;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      g[i][j] = a[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    int mn = INT_MAX;
    for (int j = 0; j < n; j++) {
      mn = min(mn, g[j][i]);
    }
    for (int j = 0; j < n; j++) {
      g[j][i] -= mn;
    }
    for (int j = 0; j < mn; j++) {
      ans2.push_back("col " + to_string(i + 1));
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < g[i][0]; j++) ans2.push_back("row " + to_string(i + 1));
    int x = g[i][0];
    for (int j = 0; j < m; j++) {
      g[i][j] -= x;
      if (g[i][j] != 0) {
        cout << -1;
        return;
      }
    }
  }
  if (ans1.size() > ans2.size()) ans1 = ans2;
  cout << ans1.size() << '\n';
  for (auto i : ans1) cout << i << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T = 1;
  while (T--) solve();
}
