#include <bits/stdc++.h>
using namespace std;
struct abc {
  int rc, x;
} st[100000];
int k = 0, ans = 0;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, C = 0;
  cin >> n >> m;
  int a[n][m];
  if (n < m) {
    int i, j, A, B;
    for (i = 0; i < n; i++) {
      A = INT_MAX;
      for (j = 0; j < m; j++) {
        cin >> a[i][j];
        if (a[i][j]) {
          C = 1;
        }
        if (a[i][j] < A) {
          A = a[i][j];
        }
        if (i > 0) {
          a[i - 1][j] -= B;
        }
      }
      ans += A;
      int kk = k + A;
      for (; k < kk; k++) {
        st[k].rc = 1;
        st[k].x = i + 1;
      }
      B = A;
    }
    for (j = 0; j < m; j++) {
      a[n - 1][j] -= B;
    }
    int ca, cb;
    for (int c = 0; c < m; c++) {
      ca = INT_MAX;
      for (int r = 0; r < n; r++) {
        if (a[r][c] < ca) {
          ca = a[r][c];
        }
        if (c > 0) {
          a[r][c - 1] -= cb;
        }
      }
      ans += ca;
      int kk = k + ca;
      for (; k < kk; k++) {
        st[k].rc = 2;
        st[k].x = c + 1;
      }
      cb = ca;
    }
    for (int r = 0; r < n; r++) {
      a[r][m - 1] -= cb;
    }
  } else {
    int i, j;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cin >> a[i][j];
        if (a[i][j]) C = 1;
      }
    }
    int ca, cb;
    for (int c = 0; c < m; c++) {
      ca = INT_MAX;
      for (int r = 0; r < n; r++) {
        if (a[r][c] < ca) {
          ca = a[r][c];
        }
        if (c > 0) {
          a[r][c - 1] -= cb;
        }
      }
      ans += ca;
      int kk = k + ca;
      for (; k < kk; k++) {
        st[k].rc = 2;
        st[k].x = c + 1;
      }
      cb = ca;
    }
    for (int r = 0; r < n; r++) {
      a[r][m - 1] -= cb;
    }
    int ra, rb;
    for (int r = 0; r < n; r++) {
      ra = INT_MAX;
      for (int c = 0; c < m; c++) {
        if (a[r][c] < ra) {
          ra = a[r][c];
        }
        if (r > 0) {
          a[r - 1][c] -= rb;
        }
      }
      ans += ra;
      int kk = k + ra;
      for (; k < kk; k++) {
        st[k].rc = 1;
        st[k].x = r + 1;
      }
      rb = ra;
    }
    for (int c = 0; c < m; c++) {
      a[n - 1][c] -= rb;
    }
  }
  int flag = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] != 0) {
        flag = 1;
        break;
      }
    }
    if (flag) break;
  }
  if (C) {
    if (flag == 1) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
      for (int i = 0; i < k; i++) {
        if (st[i].rc == 1)
          cout << "row ";
        else
          cout << "col ";
        cout << st[i].x << endl;
      }
    }
  } else {
    cout << 0 << endl;
  }
  return 0;
}
