#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const long long mod = 1000000007;
const long long N = 10001;
const long long alp = 26;
const long long inf = 2e9;
const long long infll = 3e18;
vector<pair<long long, long long> > bv, av;
string col(int i) {
  string ans = "col ";
  string num = "";
  while (i) {
    num += (char)((i % 10) + '0');
    i /= 10;
  }
  reverse(num.begin(), num.end());
  return ans + num;
}
string row(int i) {
  string ans = "row ";
  string num = "";
  while (i) {
    num += (char)((i % 10) + '0');
    i /= 10;
  }
  reverse(num.begin(), num.end());
  return ans + num;
}
long long solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n, vector<long long>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  long long mn = 1e9;
  for (int i = 0; i < m; i++) mn = min(mn, a[0][i]);
  int tans = 1e9;
  int ti = 0;
  vector<vector<long long> > b = a;
  for (int t = 0; t <= mn; t++) {
    vector<string> ans;
    for (int j = 0; j < m; j++) {
      int dl = a[0][j] - t;
      for (int q = 0; q < dl; q++) ans.push_back(col(j + 1));
      for (int i = 0; i < n; i++) a[i][j] -= dl;
    }
    bool ch = true;
    for (int i = 0; i < n; i++) {
      if (!ch) break;
      if (a[i][0] < 0) {
        ch = false;
        break;
      }
      for (int j = 1; j < m; j++)
        if (a[i][j] != a[i][j - 1] || a[i][j - 1] < 0) {
          ch = false;
          break;
        }
      for (int j = 0; j < a[i][0]; j++) ans.push_back(row(i + 1));
    }
    a = b;
    if (!ch) continue;
    if (ans.size() < tans) {
      tans = ans.size();
      ti = t;
    }
  }
  vector<string> ans;
  for (int j = 0; j < m; j++) {
    int dl = a[0][j] - ti;
    for (int q = 0; q < dl; q++) ans.push_back(col(j + 1));
    for (int i = 0; i < n; i++) a[i][j] -= dl;
  }
  for (int i = 0; i < n; i++) {
    if (a[i][0] < 0) {
      cout << -1 << endl;
      return 0;
    }
    for (int j = 1; j < m; j++)
      if (a[i][j] != a[i][j - 1] || a[i][j - 1] < 0) {
        cout << -1 << endl;
        return 0;
      }
    for (int j = 0; j < a[i][0]; j++) ans.push_back(row(i + 1));
  }
  cout << ans.size() << endl;
  for (auto it : ans) cout << it << '\n';
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
