#include <bits/stdc++.h>
using namespace std;
void solution() {
  int n, m;
  cin >> n >> m;
  int g[n + 10][m + 10];
  vector<pair<int, int> > row;
  vector<pair<int, int> > col;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> g[i][j];
    }
  }
  if (n <= m) {
    for (int i = 1; i <= n; ++i) {
      int mn = 1000;
      for (int j = 1; j <= m; ++j) {
        mn = min(mn, g[i][j]);
      }
      if (mn != 0) {
        row.push_back(make_pair(i, mn));
      }
      for (int j = 1; j <= m; ++j) {
        g[i][j] -= mn;
      }
    }
    for (int i = 1; i <= m; ++i) {
      int mn = 1000;
      for (int j = 1; j <= n; ++j) {
        mn = min(mn, g[j][i]);
      }
      if (mn != 0) {
        col.push_back(make_pair(i, mn));
      }
      for (int j = 1; j <= n; ++j) {
        g[j][i] -= mn;
      }
    }
  } else {
    for (int i = 1; i <= m; ++i) {
      int mn = 1000;
      for (int j = 1; j <= n; ++j) {
        mn = min(mn, g[j][i]);
      }
      if (mn != 0) {
        col.push_back(make_pair(i, mn));
      }
      for (int j = 1; j <= n; ++j) {
        g[j][i] -= mn;
      }
    }
    for (int i = 1; i <= n; ++i) {
      int mn = 1000;
      for (int j = 1; j <= m; ++j) {
        mn = min(mn, g[i][j]);
      }
      if (mn != 0) {
        row.push_back(make_pair(i, mn));
      }
      for (int j = 1; j <= m; ++j) {
        g[i][j] -= mn;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (g[i][j] != 0) {
        cout << -1 << endl;
        return;
      }
    }
  }
  int sum = 0;
  for (int i = 0; i < row.size(); ++i) {
    sum += row[i].second;
  }
  for (int i = 0; i < col.size(); ++i) {
    sum += col[i].second;
  }
  cout << sum << endl;
  for (int i = 0; i < row.size(); ++i) {
    int pos = row[i].first;
    int k = row[i].second;
    while (k != 0) {
      cout << "row " << pos << endl;
      k--;
    }
  }
  for (int i = 0; i < col.size(); ++i) {
    int pos = col[i].first;
    int k = col[i].second;
    while (k != 0) {
      cout << "col " << pos << endl;
      k--;
    }
  }
}
int main() {
  int test = 1;
  while (test--) {
    solution();
    cout << endl;
  }
}
