#include <bits/stdc++.h>
using namespace std;
inline void R(int &v) {
  static char ch;
  v = 0;
  bool p = 0;
  do {
    ch = getchar();
    if (ch == '-') p = 1;
  } while (!isdigit(ch));
  while (isdigit(ch)) {
    v = (v + (v << 2) << 1) + (ch ^ '0');
    ch = getchar();
  }
  if (p) v = -v;
}
int ret;
struct daan {
  int kind, num;
} ans[1000005];
int jishu;
int ma[105][105];
int n, m;
bool pd;
int inf;
inline void caozuo(int i, int j) {
  int minheng = inf, minshu = inf;
  for (int k = 1; k <= m; ++k) {
    if (k != j) minheng = min(minheng, ma[i][k]);
  }
  for (int k = 1; k <= n; ++k) {
    if (k != i) minshu = min(minshu, ma[k][j]);
  }
  if (ma[i][j] > 0 && minheng == 0 && minshu == 0) {
    pd = 0;
    return;
  }
  while (minheng > 0 && ma[i][j] > 0) {
    for (int k = 1; k <= m; ++k) {
      ma[i][k]--;
    }
    minheng--;
    ans[++jishu].kind = 1, ans[jishu].num = i;
  }
  while (minshu > 0 && ma[i][j] > 0) {
    for (int k = 1; k <= n; ++k) {
      ma[k][j]--;
    }
    minshu--;
    ans[++jishu].kind = 2, ans[jishu].num = j;
  }
}
inline void caozuo1(int i, int j) {
  int minheng = inf, minshu = inf;
  for (int k = 1; k <= m; ++k) {
    if (k != j) minheng = min(minheng, ma[i][k]);
  }
  for (int k = 1; k <= n; ++k) {
    if (k != i) minshu = min(minshu, ma[k][j]);
  }
  if (ma[i][j] > 0 && minheng == 0 && minshu == 0) {
    pd = 0;
    return;
  }
  while (minshu > 0 && ma[i][j] > 0) {
    for (int k = 1; k <= n; ++k) {
      ma[k][j]--;
    }
    minshu--;
    ans[++jishu].kind = 2, ans[jishu].num = j;
  }
  while (minheng > 0 && ma[i][j] > 0) {
    for (int k = 1; k <= m; ++k) {
      ma[i][k]--;
    }
    minheng--;
    ans[++jishu].kind = 1, ans[jishu].num = i;
  }
}
int main() {
  R(n), R(m);
  pd = 1;
  memset(ma, 127, sizeof(ma));
  inf = ma[0][0];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      R(ma[i][j]);
    }
  }
  if (m >= n) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) {
        caozuo(i, j);
        if (!pd) {
          puts("-1");
          return 0;
        }
      }
    }
  } else {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) {
        caozuo1(i, j);
        if (!pd) {
          puts("-1");
          return 0;
        }
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (ma[i][j]) {
        puts("-1");
        return 0;
      }
    }
  }
  printf("%d\n", jishu);
  for (int i = 1; i <= jishu; ++i) {
    if (ans[i].kind == 1) {
      printf("row %d\n", ans[i].num);
    } else
      printf("col %d\n", ans[i].num);
  }
  return 0;
}
