#include <bits/stdc++.h>
using namespace std;
int A[105][105];
int R[105], C[105];
int mini = 0, ans;
int n, m;
bool flip = 0;
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(0);
  cin >> n >> m;
  bool fail = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> A[i][j];
  if (m > n) {
    for (int i = 0; i < 100; i++)
      for (int j = 0; j < 100; j++)
        if (i > j) swap(A[i][j], A[j][i]);
    swap(m, n);
    flip = 1;
  }
  for (int i = 0; i < m; i++) {
    C[i] = A[0][i];
  }
  for (int i = 0; i < n; i++) {
    R[i] = A[i][0] - C[0];
    mini = min(mini, R[i]);
  }
  for (int i = 0; i < n; i++) {
    R[i] -= mini;
    ans += R[i];
  }
  for (int i = 0; i < m; i++) {
    C[i] += mini;
    ans += C[i];
    if (C[i] < 0) fail = 1;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (A[i][j] != R[i] + C[j]) fail = 1;
  if (!fail) {
    if (flip) {
      for (int i = 0; i < 100; i++)
        for (int j = 0; j < 100; j++)
          if (i > j) swap(A[i][j], A[j][i]);
      swap(m, n);
      for (int i = 0; i < 100; i++) swap(R[i], C[i]);
    }
    cout << ans << endl;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < R[i]; j++) cout << "row " << i + 1 << endl;
    for (int i = 0; i < m; i++)
      for (int j = 0; j < C[i]; j++) cout << "col " << i + 1 << endl;
  } else
    cout << -1 << endl;
}
