#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 + 10;
int n, m;
int a[MAX_N][MAX_N], temp[MAX_N][MAX_N];
int ans = 1000000000;
vector<int> h, v;
void f(int x) {
  int ansv[MAX_N], ansh[MAX_N];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      temp[i][j] = a[i][j];
    }
  }
  ansh[1] = x;
  for (int j = 1; j <= m; j++) {
    temp[1][j] -= x;
    ansv[j] = temp[1][j];
    for (int i = 1; i <= n; i++) {
      temp[i][j] -= ansv[j];
    }
  }
  for (int i = 2; i <= n; i++) {
    ansh[i] = temp[i][1];
    for (int j = 1; j <= m; j++) {
      temp[i][j] -= ansh[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (temp[i][j] != 0) {
        return;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ansh[i] < 0) {
      return;
    }
  }
  for (int i = 1; i <= m; i++) {
    if (ansv[i] < 0) {
      return;
    }
  }
  int move = 0;
  for (int i = 1; i <= n; i++) {
    move += ansh[i];
  }
  for (int i = 1; i <= m; i++) {
    move += ansv[i];
  }
  if (ans > move) {
    ans = move;
    h.clear();
    v.clear();
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= ansh[i]; j++) {
        h.push_back(i);
      }
    }
    for (int i = 1; i <= m; i++) {
      for (int j = 1; j <= ansv[i]; j++) {
        v.push_back(i);
      }
    }
  }
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = a[1][1]; i >= 0; i--) {
    f(i);
  }
  if (ans == 1e9) {
    cout << "-1" << endl;
  } else {
    cout << ans << endl;
    for (int i = 0; i < h.size(); i++) {
      cout << "row " << h[i] << endl;
    }
    for (int i = 0; i < v.size(); i++) {
      cout << "col " << v[i] << endl;
    }
  }
}
