#include <bits/stdc++.h>
const int N = 110;
int a[N][N], r[N], c[N];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        scanf("%d", &a[i][j]);
      }
    }
    int ans(-1), r0;
    for (int k = 0; k <= a[0][0]; ++k) {
      r[0] = k;
      bool f = true;
      for (int j = 0; j < m; ++j) {
        c[j] = a[0][j] - r[0];
        if (c[j] < 0) f = false;
      }
      if (!f) continue;
      for (int i = 1; i < n; ++i) {
        r[i] = a[i][0] - c[0];
        for (int j = 0; j < m; ++j) {
          if (a[i][j] - c[j] != a[i][0] - c[0]) f = false;
        }
        if (r[i] < 0) f = false;
        if (!f) break;
      }
      if (!f) continue;
      int tmp(0);
      for (int i = 0; i < n; ++i) tmp += r[i];
      for (int j = 0; j < m; ++j) tmp += c[j];
      if ((ans == -1 || ans > tmp)) ans = tmp, r0 = k;
    }
    if (ans != -1) {
      printf("%d\n", ans);
      r[0] = r0;
      for (int j = 0; j < m; ++j)
        if (a[0][j] - r[0]) {
          c[j] = a[0][j] - r[0];
          for (int k = 0; k < c[j]; ++k) printf("col %d\n", j + 1);
        }
      for (int i = 0; i < n; ++i)
        for (int k = 0; k < a[i][0] - c[0]; ++k) printf("row %d\n", i + 1);
    } else {
      puts("-1");
    }
  }
  return 0;
}
