#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  long long sum = 0;
  vector<pair<int, bool> > ans;
  vector<vector<int> > pole(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> pole[i][j];
      sum += pole[i][j];
    }
  }
  if (n < m) {
    for (int i = 0; i < n; i++) {
      bool hj = 1;
      int minn = 501;
      for (int j = 0; j < m; j++) {
        if (pole[i][j] == 0) {
          hj = 0;
          break;
        }
        minn = min(minn, pole[i][j]);
      }
      if (hj) {
        for (int j = 0; j < m; j++) {
          pole[i][j] -= minn;
          sum -= minn;
        }
        for (int ii = 0; ii < minn; ii++) {
          ans.push_back(make_pair(i + 1, 1));
        }
      }
    }
    for (int j = 0; j < m; j++) {
      bool hj = 1;
      int minn = 501;
      for (int i = 0; i < n; i++) {
        if (pole[i][j] == 0) {
          hj = 0;
          break;
        }
        minn = min(minn, pole[i][j]);
      }
      if (hj) {
        for (int i = 0; i < n; i++) {
          pole[i][j] -= minn;
          sum -= minn;
        }
        for (int ii = 0; ii < minn; ii++) {
          ans.push_back(make_pair(j + 1, 0));
        }
      }
    }
  } else {
    for (int j = 0; j < m; j++) {
      bool hj = 1;
      int minn = 501;
      for (int i = 0; i < n; i++) {
        if (pole[i][j] == 0) {
          hj = 0;
          break;
        }
        minn = min(minn, pole[i][j]);
      }
      if (hj) {
        for (int i = 0; i < n; i++) {
          pole[i][j] -= minn;
          sum -= minn;
        }
        for (int ii = 0; ii < minn; ii++) {
          ans.push_back(make_pair(j + 1, 0));
        }
      }
    }
    for (int i = 0; i < n; i++) {
      bool hj = 1;
      int minn = 501;
      for (int j = 0; j < m; j++) {
        if (pole[i][j] == 0) {
          hj = 0;
          break;
        }
        minn = min(minn, pole[i][j]);
      }
      if (hj) {
        for (int j = 0; j < m; j++) {
          pole[i][j] -= minn;
          sum -= minn;
        }
        for (int ii = 0; ii < minn; ii++) {
          ans.push_back(make_pair(i + 1, 1));
        }
      }
    }
  }
  if (sum != 0) {
    cout << "-1";
    return 0;
  }
  string kek[2];
  kek[0] = "col";
  kek[1] = "row";
  reverse(ans.begin(), ans.end());
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << kek[ans[i].second] << " " << ans[i].first << "\n";
  }
}
