#include <bits/stdc++.h>
using namespace std;
int a[101][101];
int main() {
  int n, m;
  while (cin >> n >> m) {
    queue<int> row, clu;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) cin >> a[i][j];
    }
    if (n <= m) {
      for (int i = 1; i <= n; i++) {
        int minn = a[i][1];
        for (int j = 1; j <= m; j++) minn = min(minn, a[i][j]);
        for (int j = 1; j <= m; j++) a[i][j] -= minn;
        while (minn--) row.push(i), ans++;
      }
      for (int j = 1; j <= m; j++) {
        int minn = a[1][j];
        for (int i = 1; i <= n; i++) minn = min(minn, a[i][j]);
        for (int i = 1; i <= n; i++) a[i][j] -= minn;
        while (minn--) clu.push(j), ans++;
      }
    } else {
      for (int j = 1; j <= m; j++) {
        int minn = a[1][j];
        for (int i = 1; i <= n; i++) minn = min(minn, a[i][j]);
        for (int i = 1; i <= n; i++) a[i][j] -= minn;
        while (minn--) clu.push(j), ans++;
      }
      for (int i = 1; i <= n; i++) {
        int minn = a[i][1];
        for (int j = 1; j <= m; j++) minn = min(minn, a[i][j]);
        for (int j = 1; j <= m; j++) a[i][j] -= minn;
        while (minn--) row.push(i), ans++;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++)
        if (a[i][j]) ans = -1;
    }
    printf("%d\n", ans);
    if (ans == -1) continue;
    while (!row.empty()) printf("row %d\n", row.front()), row.pop();
    while (!clu.empty()) printf("col %d\n", clu.front()), clu.pop();
  }
  return 0;
}
