#include <bits/stdc++.h>
using namespace std;
int n, m, a[505][505];
vector<int> ans[2];
void solve(int x, int y, bool z) {
  for (int i = 0; i < x; i++) {
    int mn = 1e9;
    for (int j = 0; j < y; j++) mn = min(mn, z ? a[j][i] : a[i][j]);
    for (int j = 0; j < y; j++) z ? a[j][i] -= mn : a[i][j] -= mn;
    while (mn--) ans[z].push_back(i + 1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> a[i][j];
  if (n < m)
    solve(n, m, 0), solve(m, n, 1);
  else
    solve(m, n, 1), solve(n, m, 0);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j]) return puts("-1");
  cout << ans[0].size() + ans[1].size() << "\n";
  for (auto i : ans[0]) cout << "row " << i << "\n";
  for (auto i : ans[1]) cout << "col " << i << "\n";
}
