#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const int INF = 0x3f3f3f3f;
int n, m;
int a[MAXN][MAXN];
vector<pair<int, int> > vec;
void f(int x, int y) {
  if (n < m) {
    int Min = INF;
    for (int i = 1; i <= m; i++) {
      Min = min(Min, a[x][i]);
    }
    if (Min > 0) {
      for (int i = 1; i <= Min; i++) vec.push_back(make_pair(0, x));
    }
    for (int i = 1; i <= m; i++) a[x][i] -= Min;
    Min = INF;
    for (int i = 1; i <= n; i++) {
      Min = min(Min, a[i][y]);
    }
    if (Min > 0) {
      for (int i = 1; i <= Min; i++) vec.push_back(make_pair(1, y));
    }
    for (int i = 1; i <= n; i++) a[i][y] -= Min;
  } else {
    int Min = INF;
    for (int i = 1; i <= n; i++) {
      Min = min(Min, a[i][y]);
    }
    if (Min > 0) {
      for (int i = 1; i <= Min; i++) vec.push_back(make_pair(1, y));
    }
    for (int i = 1; i <= n; i++) a[i][y] -= Min;
    Min = INF;
    for (int i = 1; i <= m; i++) {
      Min = min(Min, a[x][i]);
    }
    if (Min > 0) {
      for (int i = 1; i <= Min; i++) vec.push_back(make_pair(0, x));
    }
    for (int i = 1; i <= m; i++) a[x][i] -= Min;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == 0) continue;
      f(i, j);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] > 0) {
        puts("-1");
        return 0;
      }
    }
  }
  printf("%d\n", vec.size());
  for (int i = 0; i < (int)vec.size(); i++) {
    if (vec[i].first == 0)
      printf("row %d\n", vec[i].second);
    else
      printf("col %d\n", vec[i].second);
  }
  return 0;
}
