#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2;
int n, m;
int g[MAXN][MAXN];
int addn[MAXN], addm[MAXN];
int go(int beg) {
  addn[0] = beg;
  for (int i = 1; i < n; i++) addn[i] = addn[i - 1] + g[i][0] - g[i - 1][0];
  addm[0] = g[0][0] - beg;
  for (int j = 1; j < m; j++) addm[j] = addm[j - 1] + g[0][j] - g[0][j - 1];
  for (int i = 0; i < n; i++)
    if (addn[i] < 0) return 1e9;
  for (int j = 0; j < m; j++)
    if (addm[j] < 0) return 1e9;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (addn[i] + addm[j] != g[i][j]) return 1e9;
  int res = 0;
  for (int i = 0; i < n; i++) res += addn[i];
  for (int j = 0; j < m; j++) res += addm[j];
  return res;
}
int32_t main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> g[i][j];
  for (int i = 0; i < n - 1; i++)
    for (int j = 0; j < m; j++)
      if (g[i + 1][j] - g[i][j] != g[i + 1][0] - g[i][0]) {
        cout << -1 << endl;
        return 0;
      }
  for (int j = 0; j < m - 1; j++)
    for (int i = 0; i < n; i++)
      if (g[i][j + 1] - g[i][j] != g[0][j + 1] - g[0][j]) {
        cout << -1 << endl;
        return 0;
      }
  int ans = 1e9, b = -1;
  for (int beg = 0; beg <= g[0][0]; beg++) {
    int cur = go(beg);
    if (cur < ans) ans = cur, b = beg;
  }
  go(b);
  cout << ans << endl;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < addn[i]; j++) cout << "row " << i + 1 << endl;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < addm[j]; i++) cout << "col " << j + 1 << endl;
  return 0;
}
