#include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int chico[105];
vector<pair<string, int> > res;
int main() {
  int n = 0, m = 0, g = 0, i = 0, j = 0;
  bool flag = 0;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &mat[i][j]);
  if (n <= m) {
    for (i = 0; i < n; i++) {
      g = INT_MAX;
      for (j = 0; j < m; j++) g = min(g, mat[i][j]);
      for (j = 1; j <= g; j++) res.push_back(make_pair("row", i + 1));
      for (j = 0; j < m; j++) mat[i][j] -= g;
    }
    for (i = 0; i < m; i++) {
      g = INT_MIN;
      for (j = 0; j < n; j++) g = max(g, mat[j][i]);
      for (j = 1; j <= g; j++) res.push_back(make_pair("col", i + 1));
      for (j = 0; j < m; j++) mat[j][i] -= g;
    }
    flag = 1;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (mat[i][j] != 0) {
          flag = 0;
          break;
        }
      }
    }
    if (flag) {
      printf("%d\n", (int)(res.size()));
      for (i = 0; i < res.size(); i++)
        cout << res[i].first << " " << res[i].second << endl;
    } else
      printf("-1\n");
  } else {
    for (i = 0; i < m; i++) {
      g = INT_MAX;
      for (j = 0; j < n; j++) g = min(g, mat[j][i]);
      chico[i] = g;
      for (j = 1; j <= g; j++) res.push_back(make_pair("col", i + 1));
      for (j = 0; j < n; j++) mat[j][i] -= g;
    }
    for (i = 0; i < n; i++) {
      g = INT_MIN;
      for (j = 0; j < m; j++) g = max(g, mat[i][j]);
      for (j = 1; j <= g; j++) res.push_back(make_pair("row", i + 1));
      for (j = 0; j < m; j++) mat[i][j] -= g;
    }
    flag = 1;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (mat[i][j] != 0) {
          flag = 0;
          break;
        }
      }
    }
    if (flag) {
      printf("%d\n", (int)(res.size()));
      for (i = 0; i < res.size(); i++)
        cout << res[i].first << " " << res[i].second << endl;
    } else
      printf("-1\n");
  }
  return 0;
}
