#include <bits/stdc++.h>
using namespace std;
int a[505][505];
int b[505][505];
int n, m;
int mnCol[505];
int mnRow[505];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  vector<pair<int, int> > inc;
  if (n < m) {
    for (int i = 0; i < n; i++) {
      mnRow[i] = 1e9;
      for (int j = 0; j < m; j++) mnRow[i] = min(mnRow[i], a[i][j]);
      for (int j = 0; j < m; j++) b[i][j] = mnRow[i];
      for (int j = 0; j < mnRow[i]; j++) inc.push_back(make_pair(0, i + 1));
      for (int j = 0; j < m; j++) a[i][j] -= mnRow[i];
    }
    for (int j = 0; j < m; j++) {
      mnCol[j] = 1e9;
      for (int i = 0; i < n; i++) mnCol[j] = min(mnCol[j], a[i][j]);
      for (int i = 0; i < n; i++) b[i][j] += mnCol[j];
      for (int i = 0; i < mnCol[j]; i++) inc.push_back(make_pair(1, j + 1));
      for (int i = 0; i < n; i++) a[i][j] -= mnCol[j];
    }
    bool ok = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) {
        ok |= a[i][j];
      }
    if (ok) {
      printf("-1\n");
      return 0;
    } else {
      printf("%d\n", inc.size());
      for (int i = 0; i < (int)inc.size(); i++) {
        if (inc[i].first == 0) {
          printf("row ");
        } else {
          printf("col ");
        }
        printf("%d\n", inc[i].second);
      }
    }
  } else {
    for (int j = 0; j < m; j++) {
      mnCol[j] = 1e9;
      for (int i = 0; i < n; i++) mnCol[j] = min(mnCol[j], a[i][j]);
      for (int i = 0; i < n; i++) b[i][j] += mnCol[j];
      for (int i = 0; i < mnCol[j]; i++) inc.push_back(make_pair(1, j + 1));
      for (int i = 0; i < n; i++) a[i][j] -= mnCol[j];
    }
    for (int i = 0; i < n; i++) {
      mnRow[i] = 1e9;
      for (int j = 0; j < m; j++) mnRow[i] = min(mnRow[i], a[i][j]);
      for (int j = 0; j < m; j++) b[i][j] = mnRow[i];
      for (int j = 0; j < mnRow[i]; j++) inc.push_back(make_pair(0, i + 1));
      for (int j = 0; j < m; j++) a[i][j] -= mnRow[i];
    }
    bool ok = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) {
        ok |= a[i][j];
      }
    if (ok) {
      printf("-1\n");
      return 0;
    } else {
      printf("%d\n", inc.size());
      for (int i = 0; i < (int)inc.size(); i++) {
        if (inc[i].first == 0) {
          printf("row ");
        } else {
          printf("col ");
        }
        printf("%d\n", inc[i].second);
      }
    }
  }
  return 0;
}
