#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  long long int ar[n + 1][m + 1];
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++) cin >> ar[i][j];
  long long int mini[n + 1];
  long long int mina = 1e18;
  for (long long int i = 0; i < n; i++) mini[i] = 1e18;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++) mina = min(mina, ar[i][j]);
  ans += mina * (min(m, n));
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++) ar[i][j] -= mina;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      mini[i] = min(mini[i], ar[i][j]);
    }
    ans += mini[i];
  }
  for (long long int i = 0; i < n; i++)
    for (long long int j = 0; j < m; j++) {
      ar[i][j] -= mini[i];
    }
  long long int mini2[m + 1];
  for (long long int i = 0; i < m; i++) mini2[i] = 1e18;
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 0; j < n; j++) {
      mini2[i] = min(mini2[i], ar[j][i]);
    }
    ans += mini2[i];
  }
  for (long long int i = 0; i < m; i++)
    for (long long int j = 0; j < n; j++) {
      ar[j][i] -= mini2[i];
    }
  long long int flag = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (ar[i][j] != 0) flag = 1;
    }
  }
  if (flag == 1)
    cout << "-1";
  else {
    cout << ans << '\n';
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < mini[i]; j++) {
        cout << "row " << i + 1 << '\n';
      }
    }
    for (long long int i = 0; i < m; i++) {
      for (long long int j = 0; j < mini2[i]; j++) {
        cout << "col " << i + 1 << '\n';
      }
    }
    if (mina > 0) {
      if (n > m) {
        for (long long int i = 0; i < m; i++) {
          for (long long int j = 0; j < mina; j++) {
            cout << "col " << i + 1 << '\n';
          }
        }
      } else {
        for (long long int i = 0; i < n; i++) {
          for (long long int j = 0; j < mina; j++) {
            cout << "row " << i + 1 << '\n';
          }
        }
      }
    }
  }
  return 0;
}
