#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
int maap[110][110];
struct node {
  int w;
  int flag;
} ans[maxn];
int main() {
  int i, j;
  int flag = 0;
  int num = 1;
  int x, y;
  scanf("%d%d", &x, &y);
  int n, m;
  n = x, m = y;
  if (x < y)
    flag = 0;
  else
    flag = 1;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &maap[i][j]);
  if (flag == 0) {
    for (i = 0; i < n; i++) {
      int minn = 1e5;
      for (j = 0; j < m; j++)
        if (maap[i][j] < minn) minn = maap[i][j];
      for (j = 0; j < m; j++) maap[i][j] -= minn;
      while (minn--) ans[num].w = 1, ans[num++].flag = i + 1;
    }
    for (j = 0; j < m; j++) {
      int minn = 1e5;
      for (i = 0; i < n; i++)
        if (maap[i][j] < minn) minn = maap[i][j];
      for (i = 0; i < n; i++) maap[i][j] -= minn;
      while (minn--) ans[num].w = 2, ans[num++].flag = j + 1;
    }
  } else {
    for (j = 0; j < m; j++) {
      int minn = 1e5;
      for (i = 0; i < n; i++)
        if (maap[i][j] < minn) minn = maap[i][j];
      for (i = 0; i < n; i++) maap[i][j] -= minn;
      while (minn--) ans[num].w = 2, ans[num++].flag = j + 1;
    }
    for (i = 0; i < n; i++) {
      int minn = 1e5;
      for (j = 0; j < m; j++)
        if (maap[i][j] < minn) minn = maap[i][j];
      for (j = 0; j < m; j++) maap[i][j] -= minn;
      while (minn--) ans[num].w = 1, ans[num++].flag = i + 1;
    }
  }
  int sum = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) sum += maap[i][j];
  if (sum != 0)
    printf("-1\n");
  else {
    printf("%d\n", --num);
    for (i = 1; i <= num; i++) {
      if (ans[i].w == 1)
        printf("row ");
      else
        printf("col ");
      printf("%d\n", ans[i].flag);
    }
  }
}
