#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e11;
const long long mod = 1e9 + 7;
const long long N = 110;
long long a[N][N], mn = inf, n, m;
vector<long long> r(N, inf), c(N, inf);
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (m); ++j) cin >> a[i][j];
  if (m > n) {
    for (long long i = 0; i < (n); ++i)
      for (long long j = 0; j < (m); ++j) r[i] = min(a[i][j], r[i]);
    for (long long i = 0; i < (n); ++i)
      for (long long j = 0; j < (m); ++j) c[j] = min(c[j], a[i][j] - r[i]);
  } else {
    for (long long i = 0; i < (n); ++i)
      for (long long j = 0; j < (m); ++j) c[j] = min(c[j], a[i][j]);
    for (long long i = 0; i < (n); ++i)
      for (long long j = 0; j < (m); ++j) r[i] = min(a[i][j] - c[j], r[i]);
  }
  long long br = 0;
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (m); ++j)
      if (a[i][j] != r[i] + c[j]) br = 1;
  if (br == 1) {
    cout << -1;
    return 0;
  }
  long long sum = 0;
  for (long long i = 0; i < (n); ++i) sum += r[i];
  for (long long j = 0; j < (m); ++j) sum += c[j];
  cout << sum << endl;
  for (long long i = 0; i < (n); ++i)
    while (r[i]--) cout << "row " << i + 1 << endl;
  for (long long j = 0; j < (m); ++j)
    while (c[j]--) cout << "col " << j + 1 << endl;
}
