#include <bits/stdc++.h>
using namespace std;
int mp[105][105];
int mp1[105][105];
int n, m;
int num[2][500000];
int main() {
  int ans = 0;
  int ans1 = 0;
  cin >> n >> m;
  int cnt = 0;
  int cnt1 = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &mp[i][j]), mp1[i][j] = mp[i][j];
  for (int i = 1; i <= n; i++) {
    int Min = 1e9;
    for (int j = 1; j <= m; j++) {
      Min = min(Min, mp[i][j]);
    }
    if (Min) {
      ans += Min;
      for (int j = 1; j <= Min; j++) {
        num[0][cnt++] = i;
      }
      for (int j = 1; j <= m; j++) mp[i][j] -= Min;
    }
  }
  for (int i = 1; i <= m; i++) {
    int Min = 1e9;
    for (int j = 1; j <= n; j++) {
      Min = min(Min, mp[j][i]);
    }
    if (Min) {
      ans += Min;
      for (int j = 1; j <= Min; j++) {
        num[0][cnt++] = -i;
      }
      for (int j = 1; j <= n; j++) mp[j][i] -= Min;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (mp[i][j] > 0) {
        return printf("-1\n"), 0;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    int Min = 1e9;
    for (int j = 1; j <= n; j++) {
      Min = min(Min, mp1[j][i]);
    }
    if (Min) {
      ans1 += Min;
      for (int j = 1; j <= Min; j++) {
        num[1][cnt1++] = -i;
      }
      for (int j = 1; j <= n; j++) mp1[j][i] -= Min;
    }
  }
  for (int i = 1; i <= n; i++) {
    int Min = 1e9;
    for (int j = 1; j <= m; j++) {
      Min = min(Min, mp1[i][j]);
    }
    if (Min) {
      ans1 += Min;
      for (int j = 1; j <= Min; j++) {
        num[1][cnt1++] = i;
      }
      for (int j = 1; j <= m; j++) mp1[i][j] -= Min;
    }
  }
  int id;
  int xx;
  cout << min(ans, ans1) << endl;
  if (ans < ans1)
    id = 0, xx = cnt;
  else
    id = 1, xx = cnt1;
  for (int i = 0; i < xx; i++) {
    if (num[id][i] > 0) {
      printf("row %d\n", num[id][i]);
    } else {
      printf("col %d\n", -num[id][i]);
    }
  }
  return 0;
}
