#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T &m, const T &v) {
  if (v > m) return m = v, true;
  return false;
}
template <typename T>
bool chmin(T &m, const T &v) {
  if (v < m) return m = v, true;
  return false;
}
static const int HMAX32 = INT32_MAX / 2;
static const int HMIN32 = -HMAX32;
static const int64_t HMAX64 = INT64_MAX / 2;
static const int64_t HMIN64 = -HMAX64;
void fast_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
static const int maxn = 105;
int arr[maxn][maxn];
int row[maxn], col[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    int rm = INT_MAX;
    for (int j = 1; j <= m; ++j) {
      int t;
      scanf("%d", &t);
      arr[i][j] = t;
      chmin(rm, t);
    }
    row[i] = rm;
    for (int j = 1; j <= m; ++j) {
      arr[i][j] -= rm;
    }
  }
  for (int j = 1; j <= m; ++j) col[j] = arr[1][j];
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (arr[i][j] != arr[1][j]) {
        printf("-1\n");
        return 0;
      }
    }
  }
  if (n > m) {
    int cm = INT_MAX;
    for (int i = 1; i <= n; ++i) chmin(cm, row[i]);
    for (int i = 1; i <= n; ++i) row[i] -= cm;
    for (int j = 1; j <= m; ++j) col[j] += cm;
  }
  int nmov = 0;
  for (int i = 1; i <= n; ++i) nmov += row[i];
  for (int j = 1; j <= m; ++j) nmov += col[j];
  printf("%d\n", nmov);
  for (int i = 1; i <= n; ++i)
    for (int k = 0; k < row[i]; ++k) printf("row %d\n", i);
  for (int j = 1; j <= m; ++j)
    for (int k = 0; k < col[j]; ++k) printf("col %d\n", j);
  return 0;
}
