#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long ans = 0;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long arr[n][m];
  vector<pair<string, long long> > ans;
  string r = "row";
  string c = "col";
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  }
  if (m >= n) {
    for (long long i = 0; i < n; i++) {
      long long flag = 1;
      long long mn = INT_MAX;
      for (long long j = 0; j < m; j++) {
        if (arr[i][j] == 0) flag = 0;
        mn = min(mn, arr[i][j]);
      }
      if (flag) {
        for (long long j = 0; j < m; j++) {
          arr[i][j] -= mn;
        }
        while (mn > 0 && mn--) ans.push_back(make_pair(r, i + 1));
      }
    }
    for (long long i = 0; i < m; i++) {
      long long flag = 1;
      long long mn = INT_MAX;
      for (long long j = 0; j < n; j++) {
        if (arr[j][i] == 0) flag = 0;
        mn = min(mn, arr[j][i]);
      }
      if (flag) {
        for (long long j = 0; j < n; j++) {
          arr[j][i] -= mn;
        }
        while (mn > 0 && mn--) ans.push_back(make_pair(c, i + 1));
      }
    }
  } else {
    for (long long i = 0; i < m; i++) {
      long long flag = 1;
      long long mn = INT_MAX;
      for (long long j = 0; j < n; j++) {
        if (arr[j][i] == 0) flag = 0;
        mn = min(arr[j][i], mn);
      }
      if (flag) {
        for (long long j = 0; j < n; j++) {
          arr[j][i] -= mn;
        }
        while (mn > 0 && mn--) ans.push_back(make_pair(c, i + 1));
      }
    }
    for (long long i = 0; i < n; i++) {
      long long flag = 1;
      long long mn = INT_MAX;
      for (long long j = 0; j < m; j++) {
        if (arr[i][j] == 0) flag = 0;
        mn = min(mn, arr[i][j]);
      }
      if (flag) {
        for (long long j = 0; j < m; j++) {
          arr[i][j] -= mn;
        }
        while (mn > 0 && mn--) ans.push_back(make_pair(r, i + 1));
      }
    }
  }
  long long x = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (arr[i][j] != 0) x = 0;
    }
  }
  if (x) {
    cout << ans.size() << endl;
    for (long long i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << endl;
    }
  } else {
    cout << -1;
  }
}
