#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
const long double EPS = 1e-12;
int a[105][105];
int b[105][105];
vector<pair<pair<int, int>, int> > vec[505];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)n; i++) {
    for (int j = 0; j < (int)m; j++) {
      cin >> a[i][j];
    }
  }
  int mx = (int)(1e9);
  for (int i = 0; i < (int)m; i++) {
    mx = min(mx, a[0][i]);
  }
  int ans = (int)(2e9);
  int idx = 0;
  for (int di = 0; di < (int)mx + 1; di++) {
    int net = 0;
    int flag = 0;
    net += di;
    if (di != 0) vec[di].push_back(make_pair(make_pair(di, 0), 0));
    for (int i = 0; i < (int)n; i++) {
      for (int j = 0; j < (int)m; j++) {
        b[i][j] = 0;
      }
    }
    for (int j = 0; j < (int)m; j++) {
      b[0][j] += di;
    }
    for (int i = 0; i < (int)m; i++) {
      int dif = a[0][i] - di;
      net += dif;
      if (dif != 0) vec[di].push_back(make_pair(make_pair(dif, i), 1));
      for (int j = (int)1; j < (int)n; j++) {
        b[j][i] += dif;
      }
    }
    for (int i = (int)1; i < (int)n; i++) {
      int dif = a[i][0] - b[i][0];
      if (dif < 0) flag = 1;
      net += dif;
      if (dif != 0) vec[di].push_back(make_pair(make_pair(dif, i), 0));
      for (int j = 0; j < (int)m; j++) {
        b[i][j] += dif;
        if (b[i][j] != a[i][j]) flag = 1;
      }
    }
    if (flag == 0) {
      if (ans > net) {
        ans = net;
        idx = di;
      }
    }
  }
  if (ans != (int)(2e9)) {
    cout << ans << endl;
    for (int i = 0; i < (int)vec[idx].size(); i++) {
      int val = vec[idx][i].first.first;
      int id = vec[idx][i].first.second + 1;
      if (vec[idx][i].second == 0) {
        for (int j = 0; j < (int)val; j++) {
          cout << "row " << id << endl;
        }
      } else {
        for (int j = 0; j < (int)val; j++) {
          cout << "col " << id << endl;
        }
      }
    }
  } else {
    cout << "-1" << endl;
    ;
  }
  return 0;
}
