#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 13;
const int Max = 0x7ffffffa;
int Grid[maxn][maxn];
int n, m;
struct Node {
  string name;
  int id;
  Node() {}
  Node(string _name, int _id) {
    name = _name;
    id = _id;
  }
  bool operator<(const Node t) const { return id > t.id; }
};
int GetMinRow(int nt) {
  int MinNumber = Max;
  for (int i = 0; i < m; ++i) {
    MinNumber = min(MinNumber, Grid[nt][i]);
  }
  return MinNumber;
}
int GetMinCol(int nt) {
  int MinNumber = Max;
  for (int i = 0; i < n; ++i) {
    MinNumber = min(MinNumber, Grid[i][nt]);
  }
  return MinNumber;
}
void SolveRow(stack<Node>& tmp) {
  int moveNumber = 0;
  for (int i = 0; i < n; ++i) {
    int minNumber = GetMinRow(i);
    if (minNumber) {
      for (int j = 0; j < minNumber; ++j) tmp.push(Node("row", i + 1));
      for (int j = 0; j < m; ++j) {
        Grid[i][j] -= minNumber;
      }
    }
  }
}
void SolveCol(stack<Node>& tmp) {
  for (int i = 0; i < m; ++i) {
    int minNumber = GetMinCol(i);
    if (minNumber) {
      for (int j = 0; j < minNumber; ++j) {
        tmp.push(Node("col", i + 1));
      }
      for (int j = 0; j < n; ++j) {
        Grid[j][i] -= minNumber;
      }
    }
  }
}
bool JugIsEmpty() {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (Grid[i][j]) return false;
  return true;
}
stack<Node> Solve() {
  stack<Node> res;
  int moveNumber = 0;
  if (n < m) {
    SolveRow(res);
    SolveCol(res);
  } else {
    SolveCol(res);
    SolveRow(res);
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      scanf("%d", &Grid[i][j]);
    }
  stack<Node> res = Solve();
  if (JugIsEmpty()) {
    priority_queue<Node> Line;
    cout << res.size() << "\n";
    while (!res.empty()) {
      Node it = res.top();
      res.pop();
      Line.push(it);
    }
    while (!Line.empty()) {
      Node it = Line.top();
      Line.pop();
      cout << it.name << " " << it.id << "\n";
    }
  } else {
    cout << "-1\n";
  }
  return 0;
}
