#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, m, t[N][N], bl[N][2];
vector<pair<int, int>> moves;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      scanf("%d", &t[i][j]);
      if (t[i][j] == 0) {
        bl[i][0] = 1;
        bl[j][1] = 1;
      }
    }
  if (n < m) {
    for (int i = 1; i <= n; ++i)
      while (bl[i][0] == 0) {
        moves.push_back(make_pair(0, i));
        for (int j = 1; j <= m; ++j) {
          t[i][j]--;
          if (t[i][j] == 0) {
            bl[i][0] = 1;
            bl[j][1] = 1;
          }
        }
      }
    for (int j = 1; j <= m; ++j)
      while (bl[j][1] == 0) {
        moves.push_back(make_pair(1, j));
        for (int i = 1; i <= n; ++i) {
          t[i][j]--;
          if (t[i][j] == 0) {
            bl[i][0] = 1;
            bl[j][1] = 1;
          }
        }
      }
  } else {
    for (int j = 1; j <= m; ++j)
      while (bl[j][1] == 0) {
        moves.push_back(make_pair(1, j));
        for (int i = 1; i <= n; ++i) {
          t[i][j]--;
          if (t[i][j] == 0) {
            bl[i][0] = 1;
            bl[j][1] = 1;
          }
        }
      }
    for (int i = 1; i <= n; ++i)
      while (bl[i][0] == 0) {
        moves.push_back(make_pair(0, i));
        for (int j = 1; j <= m; ++j) {
          t[i][j]--;
          if (t[i][j] == 0) {
            bl[i][0] = 1;
            bl[j][1] = 1;
          }
        }
      }
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (t[i][j] != 0) {
        puts("-1");
        return 0;
      }
  printf("%d\n", (int)moves.size());
  for (auto x : moves) {
    if (x.first == 0)
      printf("row ");
    else
      printf("col ");
    printf("%d\n", x.second);
  }
  return 0;
}
