#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int a[111][111];
void solve(istream& cin, ostream& cout) {
  int n, m;
  cin >> n >> m;
  bool sw = n > m;
  for (int i = (0); i < int(n); ++i) {
    for (int j = (0); j < int(m); ++j) {
      if (sw) {
        cin >> a[j][i];
      } else {
        cin >> a[i][j];
      }
    }
  }
  if (sw) {
    swap(n, m);
  }
  vector<pair<int, int>> ans;
  for (int i = (0); i < int(n); ++i) {
    int mn = *min_element(a[i], a[i] + m);
    if (mn > 0) {
      ans.push_back({i, mn});
      for (int j = (0); j < int(m); ++j) {
        a[i][j] -= mn;
      }
    }
  }
  for (int j = (0); j < int(m); ++j) {
    int mn = 1e9;
    for (int i = (0); i < int(n); ++i) {
      mn = min(a[i][j], mn);
    }
    if (mn > 0) {
      ans.push_back({-j - 1, mn});
      for (int i = (0); i < int(n); ++i) {
        a[i][j] -= mn;
      }
    }
  }
  for (int i = (0); i < int(n); ++i) {
    for (int j = (0); j < int(m); ++j) {
      if (a[i][j] != 0) {
        cout << -1;
        return;
      }
    }
  }
  int cop = 0;
  for (auto& i : ans) {
    cop += i.second;
  }
  cout << cop << "\n";
  for (auto& i : ans) {
    for (int j = (0); j < int(i.second); ++j) {
      if (i.first >= 0) {
        if (sw) {
          cout << "col " << i.first + 1;
        } else {
          cout << "row " << i.first + 1;
        }
      } else {
        if (sw) {
          cout << "row " << -i.first;
        } else {
          cout << "col " << -i.first;
        }
      }
      cout << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve(cin, cout);
  return 0;
}
