#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n][m];
  long long int i, j;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) cin >> a[i][j];
  long long int row[n], col[m];
  for (i = 0; i < n; i++) row[i] = *min_element(a[i], a[i] + m);
  long long int f = 0;
  long long int rr[n], cc[m];
  for (i = 0; i < m; i++) {
    long long int mi = INT_MAX;
    for (j = 0; j < n; j++) {
      mi = min(mi, a[j][i]);
    }
    cc[i] = mi;
  }
  for (j = 0; j < n; j++) {
    long long int pre = a[j][0] - cc[0];
    for (i = 0; i < m; i++) {
      if (a[j][i] - cc[i] != pre) {
        f = 1;
        break;
      }
    }
    rr[j] = pre;
  }
  vector<pair<string, long long int>> ans, ans2;
  for (j = 0; j < m; j++) {
    long long int pre = a[0][j] - row[0];
    for (i = 0; i < n; i++) {
      if (a[i][j] - row[i] != pre) {
        f = 1;
        break;
      }
    }
    col[j] = pre;
  }
  for (j = 0; j < m; j++) {
    long long int te = cc[j];
    while (te--) ans2.push_back(make_pair("col", j + 1));
  }
  for (i = 0; i < n; i++) {
    long long int te = rr[i];
    while (te--) ans2.push_back(make_pair("row", i + 1));
  }
  for (j = 0; j < m; j++) {
    long long int te = col[j];
    while (te--) ans.push_back(make_pair("col", j + 1));
  }
  for (i = 0; i < n; i++) {
    long long int te = row[i];
    while (te--) ans.push_back(make_pair("row", i + 1));
  }
  if (f)
    cout << "-1";
  else {
    long long int mm = (ans.size() < ans2.size()) ? 1 : 0;
    if (mm) {
      cout << ans.size() << "\n";
      for (i = 0; i < ans.size(); i++)
        cout << ans[i].first << " " << ans[i].second << "\n";
    } else {
      cout << ans2.size() << "\n";
      for (i = 0; i < ans2.size(); i++)
        cout << ans2[i].first << " " << ans2[i].second << "\n";
    }
  }
  return 0;
}
