#include <bits/stdc++.h>
using namespace std;
const int N = 110;
vector<int> row, col, row2, col2;
int mat[N][N], mat2[N][N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> mat[i][j];
      mat2[i][j] = mat[i][j];
    }
  while (true) {
    bool all_zero = true;
    bool get = false;
    for (int i = 0; i < n; i++) {
      int min_elem = 501;
      for (int j = 0; j < m; j++) min_elem = min(mat[i][j], min_elem);
      if (min_elem != 0) {
        for (int t = 0; t < min_elem; t++) row.push_back(i);
        get = true;
      }
      for (int j = 0; j < m; j++) mat[i][j] -= min_elem;
    }
    for (int j = 0; j < m; j++) {
      int min_elem = 501;
      for (int i = 0; i < n; i++) min_elem = min(mat[i][j], min_elem);
      if (min_elem != 0) {
        get = true;
        for (int t = 0; t < min_elem; t++) col.push_back(j);
      }
      for (int i = 0; i < n; i++) mat[i][j] -= min_elem;
    }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (mat[i][j] != 0) all_zero = false;
    if (!get && !all_zero) {
      cout << -1 << endl;
      return 0;
    }
    if (all_zero) {
      break;
    }
  }
  while (true) {
    bool all_zero = true;
    for (int j = 0; j < m; j++) {
      int min_elem = 501;
      for (int i = 0; i < n; i++) min_elem = min(mat2[i][j], min_elem);
      if (min_elem != 0) {
        for (int t = 0; t < min_elem; t++) col2.push_back(j);
      }
      for (int i = 0; i < n; i++) mat2[i][j] -= min_elem;
    }
    for (int i = 0; i < n; i++) {
      int min_elem = 501;
      for (int j = 0; j < m; j++) min_elem = min(mat2[i][j], min_elem);
      if (min_elem != 0) {
        for (int t = 0; t < min_elem; t++) row2.push_back(i);
      }
      for (int j = 0; j < m; j++) mat2[i][j] -= min_elem;
    }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (mat2[i][j] != 0) all_zero = false;
    if (all_zero) {
      break;
    }
  }
  if (col.size() + row.size() <= col2.size() + row2.size()) {
    cout << row.size() + col.size() << endl;
    for (int i = 0; i < row.size(); i++) cout << "row " << row[i] + 1 << endl;
    for (int i = 0; i < col.size(); i++) cout << "col " << col[i] + 1 << endl;
  } else {
    cout << row2.size() + col2.size() << endl;
    for (int i = 0; i < row2.size(); i++) cout << "row " << row2[i] + 1 << endl;
    for (int i = 0; i < col2.size(); i++) cout << "col " << col2[i] + 1 << endl;
  }
}
