#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int ara[104][104];
int n, m;
vector<int> ans[3];
int check(int k) {
  int cost = k;
  for (int i = 0; i < m; i++) cost += ara[0][i] - k;
  for (int i = 1; i < n; i++) {
    int first = ara[i][0] - (ara[0][0] - k);
    for (int j = 0; j < m; j++) {
      int c = ara[i][j] - (ara[0][j] - k);
      if (c != first || c < 0) return 1000000000;
    }
    cost += first;
  }
  return cost;
}
void print(int k) {
  for (int i = 0; i < k; i++) cout << "row " << 1 << endl;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < ara[0][i] - k; j++) cout << "col " << i + 1 << endl;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < ara[i][0] - (ara[0][0] - k); j++)
      cout << "row " << i + 1 << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> ara[i][j];
  int mn = *min_element(ara[0], ara[0] + m);
  int ans = -1;
  int ans_c = 1000000000;
  for (int k = 0; k <= mn; k++) {
    int cost = check(k);
    if (cost < ans_c) {
      ans_c = cost;
      ans = k;
    }
  }
  if (ans == -1)
    cout << ans << endl;
  else {
    cout << ans_c << endl;
    print(ans);
  }
}
