#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > finish(n);
  for (int i = 0; i < n; ++i) {
    vector<int> row(m);
    for (int j = 0; j < m; ++j) {
      cin >> row[j];
    }
    finish[i] = row;
  }
  int count = 0;
  bool possible = true;
  string steps = "";
  if (n < m) {
    for (int i = 0; i < n; ++i) {
      int min = *min_element(begin(finish[i]), end(finish[i]));
      if (min > 0) {
        for (int j = 0; j < m; ++j) {
          finish[i][j] -= min;
        }
        for (int s = 0; s < min; ++s) {
          steps += "row " + to_string(i + 1) + "\n";
        }
        count += min;
      }
    }
    for (int j = 0; j < m; ++j) {
      vector<int> c;
      for (int i = 0; i < n; ++i) {
        c.push_back(finish[i][j]);
      }
      int min = *min_element(begin(c), end(c));
      if (min > 0) {
        for (int i = 0; i < n; ++i) {
          finish[i][j] -= min;
        }
        for (int s = 0; s < min; ++s) {
          steps += "col " + to_string(j + 1) + "\n";
        }
        count += min;
      }
    }
  } else {
    for (int j = 0; j < m; ++j) {
      vector<int> c;
      for (int i = 0; i < n; ++i) {
        c.push_back(finish[i][j]);
      }
      int min = *min_element(begin(c), end(c));
      if (min > 0) {
        for (int i = 0; i < n; ++i) {
          finish[i][j] -= min;
        }
        for (int s = 0; s < min; ++s) {
          steps += "col " + to_string(j + 1) + "\n";
        }
        count += min;
      }
    }
    for (int i = 0; i < n; ++i) {
      int min = *min_element(begin(finish[i]), end(finish[i]));
      if (min > 0) {
        for (int j = 0; j < m; ++j) {
          finish[i][j] -= min;
        }
        for (int s = 0; s < min; ++s) {
          steps += "row " + to_string(i + 1) + "\n";
        }
        count += min;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (finish[i][j] != 0) {
        possible = false;
        break;
      }
    }
  }
  if (possible) {
    cout << count << "\n" << steps;
  } else {
    cout << -1 << "\n";
  }
  return 0;
}
