#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795l;
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 110, M = N;
int a[N][M];
int n, m;
int col[N], row[N];
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  cin >> n >> m;
  int minn = 1e9;
  for (int i = int(0); i < int(n); ++i) {
    for (int j = int(0); j < int(m); ++j) {
      cin >> a[i][j];
      if (i == 0) umn(minn, a[i][j]);
    }
  }
  int bst = -1;
  int bstsum = 0;
  for (int fst = int(0); fst < int(minn + 1); ++fst) {
    memset(col, 0, sizeof(col));
    memset(row, 0, sizeof(row));
    row[0] = fst;
    for (int i = int(0); i < int(m); ++i) {
      col[i] = a[0][i] - fst;
    }
    for (int i = int(1); i < int(n); ++i) {
      row[i] = a[i][0] - col[0];
    }
    bool check = 1;
    for (int i = int(0); i < int(n); ++i)
      for (int j = int(0); j < int(m); ++j) {
        if (row[i] < 0 || col[j] < 0) check = 0;
        if (col[j] + row[i] != a[i][j]) check = 0;
      }
    if (!check) {
      continue;
    }
    int sum = 0;
    for (int i = int(0); i < int(n); ++i) sum += row[i];
    for (int i = int(0); i < int(m); ++i) sum += col[i];
    if (bst == -1 || bstsum > sum) {
      bst = fst;
      bstsum = sum;
    }
  }
  if (bst < 0) {
    cout << -1 << endl;
    return 0;
  }
  memset(col, 0, sizeof(col));
  memset(row, 0, sizeof(row));
  row[0] = bst;
  for (int i = int(0); i < int(m); ++i) {
    col[i] = a[0][i] - bst;
  }
  for (int i = int(1); i < int(n); ++i) {
    row[i] = a[i][0] - col[0];
  }
  cout << bstsum << endl;
  for (int i = int(0); i < int(n); ++i) {
    for (int j = int(0); j < int(row[i]); ++j) {
      printf("row %d\n", i + 1);
    }
  }
  for (int i = int(0); i < int(m); ++i) {
    for (int j = int(0); j < int(col[i]); ++j) {
      printf("col %d\n", i + 1);
    }
  }
  return 0;
}
