#include <bits/stdc++.h>
using namespace std;
const char letters[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                        'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                        's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
const int dx[] = {0, -1, 0, 1, -1, -1, 1, 1};
const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int inline max3(int a, int b, int c) { return max(a, max(b, c)); }
const int N = 105;
int n, m;
int grid[N][N];
int r[N], c[N], ansr[N], ansc[N];
int main() {
  int st = 1000000100, sum = 1000000100, cnt;
  bool f;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) scanf("%d", &grid[i][j]);
  for (int i = 0; i < m; ++i) st = min(st, grid[0][i]);
  for (int i = 0; i <= st; ++i) {
    cnt = r[0] = i, f = 0;
    for (int j = 0; j < m; ++j) c[j] = grid[0][j] - i, cnt += c[j];
    for (int k = 1; k < n; ++k) {
      int tst = grid[k][0] - c[0];
      if (tst < 0) {
        f = 1;
        break;
      }
      for (int z = 1; z < m; ++z)
        if (grid[k][z] - c[z] != tst) {
          f = 1;
          break;
        }
      if (f) break;
      r[k] = tst, cnt += tst;
    }
    if (f) continue;
    if (cnt < sum) {
      sum = cnt;
      for (int i = 0; i < n; ++i) ansr[i] = r[i];
      for (int i = 0; i < m; ++i) ansc[i] = c[i];
    }
  }
  if (sum == 1000000100) sum = -1;
  printf("%d\n", sum);
  if (sum != -1) {
    for (int i = 0; i < n; ++i)
      if (ansr[i])
        for (int j = 0; j < ansr[i]; ++j) printf("row %d\n", i + 1);
    for (int i = 0; i < m; ++i)
      if (ansc[i])
        for (int j = 0; j < ansc[i]; ++j) printf("col %d\n", i + 1);
  }
  return 0;
}
