#include <bits/stdc++.h>
using namespace std;
int N, M, mm[105][105], minn;
int main(int argc, char const *argv[]) {
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) cin >> mm[i][j];
  }
  int ans = 0;
  std::vector<pair<int, int> > row;
  std::vector<pair<int, int> > col;
  if (N <= M) {
    for (int i = 1; i <= N; i++) {
      minn = (0x3f3f3f3f);
      for (int j = 1; j <= M; j++) minn = min(minn, mm[i][j]);
      for (int j = 1; j <= M; j++) mm[i][j] -= minn;
      ans += minn;
      row.push_back(make_pair(i, minn));
    }
    for (int j = 1; j <= M; j++) {
      minn = (0x3f3f3f3f);
      for (int i = 1; i <= N; i++) minn = min(minn, mm[i][j]);
      for (int i = 1; i <= N; i++) mm[i][j] -= minn;
      ans += minn;
      col.push_back(make_pair(j, minn));
    }
  } else {
    for (int j = 1; j <= M; j++) {
      minn = (0x3f3f3f3f);
      for (int i = 1; i <= N; i++) minn = min(minn, mm[i][j]);
      for (int i = 1; i <= N; i++) mm[i][j] -= minn;
      ans += minn;
      col.push_back(make_pair(j, minn));
    }
    for (int i = 1; i <= N; i++) {
      minn = (0x3f3f3f3f);
      for (int j = 1; j <= M; j++) minn = min(minn, mm[i][j]);
      for (int j = 1; j <= M; j++) mm[i][j] -= minn;
      ans += minn;
      row.push_back(make_pair(i, minn));
    }
  }
  bool ok = true;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) {
      if (mm[i][j] != 0) {
        ok = false;
        break;
      }
    }
  if (!ok) return 0 * printf("-1\n");
  printf("%d\n", ans);
  for (int i = 0; i < row.size(); i++) {
    for (int j = 0; j < row[i].second; j++) printf("row %d\n", row[i].first);
  }
  for (int i = 0; i < col.size(); i++) {
    for (int j = 0; j < col[i].second; j++) printf("col %d\n", col[i].first);
  }
  return 0;
}
