#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &s, vector<T> vec) {
  for (auto &v : vec) {
    s << v << " ";
  }
  return s;
}
template <typename T>
void print(T v) {
  cout << v << "\n";
}
template <typename T>
void prints(T v) {
  cout << v << "\n";
}
template <typename T, typename... Args>
void print(T first, Args... args) {
  cout << first << " ";
  print(args...);
}
template <typename T, typename... Args>
void prints(T first, Args... args) {
  cout << first << " | ";
  prints(args...);
}
int rowCheck(const vector<vector<int>> &mat, const int &r) {
  int minVal = 1000;
  for (int c = 0; c < mat[r].size(); ++c) {
    minVal = min(minVal, mat[r][c]);
  }
  return minVal;
}
void rowModify(vector<vector<int>> &mat, const int &r, const int &minVal) {
  for (int c = 0; c < mat[r].size(); ++c) {
    mat[r][c] -= minVal;
  }
}
int colCheck(const vector<vector<int>> &mat, const int &c) {
  int minVal = 1000;
  for (int r = 0; r < mat.size(); ++r) {
    minVal = min(minVal, mat[r][c]);
  }
  return minVal;
}
void colModify(vector<vector<int>> &mat, const int &c, const int &minVal) {
  for (int r = 0; r < mat.size(); ++r) {
    mat[r][c] -= minVal;
  }
}
void rowFunction(vector<vector<int>> &mat, stringstream &ss, int &count) {
  for (int r = 0; r < mat.size(); ++r) {
    int minVal = rowCheck(mat, r);
    if (minVal) {
      rowModify(mat, r, minVal);
      for (int t = 0; t < minVal; ++t) {
        ss << "row " << r + 1 << "\n";
      }
      count += minVal;
    }
  }
}
void colFunction(vector<vector<int>> &mat, stringstream &ss, int &count) {
  for (int c = 0; c < mat[0].size(); ++c) {
    int minVal = colCheck(mat, c);
    if (minVal) {
      colModify(mat, c, minVal);
      for (int t = 0; t < minVal; ++t) {
        ss << "col " << c + 1 << "\n";
      }
      count += minVal;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> mat(n, vector<int>(m, 0));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> mat[i][j];
  stringstream ss;
  int count = 0;
  if (n > m) {
    colFunction(mat, ss, count);
    rowFunction(mat, ss, count);
  } else {
    rowFunction(mat, ss, count);
    colFunction(mat, ss, count);
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      if (mat[i][j]) {
        cout << "-1";
        return 0;
      }
    }
  cout << count << "\n";
  cout << ss.str();
}
