#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int a[N + 7][N + 7];
bool finished() {
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (a[i][j] > 0) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  vector<pair<int, int>> out;
  if (n <= m) {
    for (int i = 1; i <= n; i++) {
      int minv = 500;
      for (int j = 1; j <= m; j++) {
        minv = min(minv, a[i][j]);
      }
      if (minv > 0) {
        for (int k = 1; k <= minv; k++) {
          out.push_back({0, i});
        }
        for (int j = 1; j <= m; j++) {
          a[i][j] -= minv;
        }
      }
    }
    for (int j = 1; j <= m; j++) {
      int minv = 500;
      for (int i = 1; i <= n; i++) {
        minv = min(minv, a[i][j]);
      }
      if (minv > 0) {
        for (int k = 1; k <= minv; k++) {
          out.push_back({1, j});
        }
        for (int i = 1; i <= n; i++) {
          a[i][j] -= minv;
        }
      }
    }
  } else {
    for (int j = 1; j <= m; j++) {
      int minv = 500;
      for (int i = 1; i <= n; i++) {
        minv = min(minv, a[i][j]);
      }
      if (minv > 0) {
        for (int k = 1; k <= minv; k++) {
          out.push_back({1, j});
        }
        for (int i = 1; i <= n; i++) {
          a[i][j] -= minv;
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      int minv = 500;
      for (int j = 1; j <= m; j++) {
        minv = min(minv, a[i][j]);
      }
      if (minv > 0) {
        for (int k = 1; k <= minv; k++) {
          out.push_back({0, i});
        }
        for (int j = 1; j <= m; j++) {
          a[i][j] -= minv;
        }
      }
    }
  }
  if (finished() == false) {
    cout << -1 << endl;
  } else {
    cout << out.size() << endl;
    for (pair<int, int> temp : out) {
      if (temp.first == 0) {
        cout << "row " << temp.second << endl;
      } else {
        cout << "col " << temp.second << endl;
      }
    }
  }
  return 0;
}
