#include <bits/stdc++.h>
using namespace std;
int n, m, g[102][102], r[102], c[102];
void f1() {
  for (int i = 1; i <= n; i++) {
    int mn = 2e9;
    for (int j = 1; j <= m; j++) mn = min(mn, g[i][j]);
    r[i] = mn;
    for (int j = 1; j <= m; j++) g[i][j] -= mn;
  }
}
void f2() {
  for (int i = 1; i <= m; i++) {
    int mn = 2e9;
    for (int j = 1; j <= n; j++) mn = min(mn, g[j][i]);
    c[i] = mn;
    for (int j = 1; j <= n; j++) g[j][i] -= mn;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &g[i][j]);
  if (n < m)
    f1(), f2();
  else
    f2(), f1();
  bool flag = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (g[i][j]) flag = 0;
  if (flag) {
    int res = 0;
    for (int i = 1; i <= n; i++) res += r[i];
    for (int i = 1; i <= m; i++) res += c[i];
    printf("%d\n", res);
    for (int i = 1; i <= n; i++)
      while (r[i]--) printf("row %d\n", i);
    for (int j = 1; j <= m; j++)
      while (c[j]--) printf("col %d\n", j);
  } else
    puts("-1");
  return 0;
}
