#include <bits/stdc++.h>
using namespace std;
int n, m;
int g[110][110];
int r[110], c[110];
int work(int x) {
  r[1] = x;
  for (int i = 1; i <= m; i++) c[i] = g[1][i] - r[1];
  for (int i = 2; i <= n; i++) r[i] = g[i][1] - c[1];
  for (int i = 1; i <= n; i++)
    if (r[i] < 0) return -1;
  for (int i = 1; i <= m; i++)
    if (c[i] < 0) return -1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (g[i][j] != r[i] + c[j]) return -1;
  int sum = 0;
  for (int i = 1; i <= n; i++) sum += r[i];
  for (int i = 1; i <= m; i++) sum += c[i];
  return sum;
}
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]);
  int ans = -1, pos = -1;
  for (int i = 0; i <= 500; i++) {
    int val = work(i);
    if (val != -1) {
      if (ans == -1 || val < ans) ans = val, pos = i;
    }
  }
  if (ans == -1) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", ans);
  work(pos);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= r[i]; j++) printf("row %d\n", i);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= c[i]; j++) printf("col %d\n", i);
  return 0;
}
