#include <bits/stdc++.h>
using namespace std;
vector<pair<bool, pair<int, int> > > mp;
int n, m;
int graph[102][102];
int ans = 0;
bool check() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (graph[i][j] > 0) return 0;
    }
  }
  return 1;
}
void row() {
  for (int x = 1; x <= n; x++) {
    int mn = 10000007;
    for (int y = 1; y <= m; y++) {
      mn = min(mn, graph[x][y]);
    }
    if (mn > 0) {
      ans += mn;
      pair<int, int> p(mn, x);
      mp.push_back(pair<bool, pair<int, int> >(0, p));
      for (int y = 1; y <= m; y++) {
        graph[x][y] -= mn;
      }
    }
  }
}
void col() {
  for (int x = 1; x <= m; x++) {
    int mn = 10000007;
    for (int y = 1; y <= n; y++) {
      mn = min(mn, graph[y][x]);
    }
    if (mn > 0) {
      ans += mn;
      pair<int, int> p(mn, x);
      mp.push_back(pair<bool, pair<int, int> >(1, p));
      for (int y = 1; y <= n; y++) {
        graph[y][x] -= mn;
      }
    }
  }
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    memset(graph, 0, sizeof(graph));
    mp.clear();
    for (int x = 1; x <= n; x++) {
      for (int y = 1; y <= m; y++) {
        scanf("%d", &graph[x][y]);
      }
    }
    if (n > m) {
      col();
      row();
    } else {
      row();
      col();
    }
    if (!check()) {
      puts("-1");
      return 0;
    } else {
      printf("%d\n", ans);
      vector<pair<bool, pair<int, int> > >::iterator it = mp.begin();
      int mpn = mp.size();
      for (it = mp.begin(); it != mp.end(); it++) {
        bool way = it->first;
        pair<int, int> pp = it->second;
        int num = pp.first;
        while (num--) {
          printf("%s %d\n", way == 0 ? "row" : "col", pp.second);
        }
      }
    }
  }
}
