#include <bits/stdc++.h>
using namespace std;
int tar[111][111];
int arr[111][111];
int need[111][111];
vector<pair<string, int> > vec1;
vector<pair<string, int> > vec2;
int row, col;
bool done() {
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      if (arr[i][j] != tar[i][j]) return false;
    }
  }
  return true;
}
void seeArr() {
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      cout << arr[i][j] << " ";
    }
    cout << "\n";
  }
  cout << "\n";
}
void makeNeed() {
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) need[i][j] = tar[i][j] - arr[i][j];
  }
}
void fillRow() {
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < row; i++) {
    if (done()) return;
    int mn = 505;
    for (int j = 0; j < col; j++) mn = min(mn, tar[i][j]);
    for (int j = 0; j < col; j++) arr[i][j] += mn;
    while (mn--) vec1.push_back(make_pair("row", i + 1));
  }
  makeNeed();
  for (int i = 0; i < col; i++) {
    if (done()) return;
    int mn = 505;
    for (int j = 0; j < row; j++) mn = min(mn, need[j][i]);
    for (int j = 0; j < row; j++) arr[j][i] += mn;
    while (mn--) vec1.push_back(make_pair("col", i + 1));
  }
}
void fillCol() {
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < col; i++) {
    if (done()) return;
    int mn = 505;
    for (int j = 0; j < row; j++) mn = min(mn, tar[j][i]);
    for (int j = 0; j < row; j++) arr[j][i] += mn;
    while (mn--) vec2.push_back(make_pair("col", i + 1));
  }
  makeNeed();
  for (int i = 0; i < row; i++) {
    if (done()) return;
    int mn = 505;
    for (int j = 0; j < col; j++) mn = min(mn, need[i][j]);
    for (int j = 0; j < col; j++) arr[i][j] += mn;
    while (mn--) vec2.push_back(make_pair("row", i + 1));
  }
}
void printVec1() {
  cout << vec1.size() << "\n";
  for (int i = 0; i < vec1.size(); i++)
    cout << vec1[i].first << " " << vec1[i].second << "\n";
}
void printVec2() {
  cout << vec2.size() << "\n";
  for (int i = 0; i < vec2.size(); i++)
    cout << vec2[i].first << " " << vec2[i].second << "\n";
}
int main() {
  cin >> row;
  cin >> col;
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) cin >> tar[i][j];
  }
  fillRow();
  bool rowErJonno = done();
  fillCol();
  bool colErJonno = done();
  if (rowErJonno && colErJonno) {
    if (vec1.size() <= vec2.size())
      printVec1();
    else
      printVec2();
  } else if (rowErJonno)
    printVec1();
  else if (colErJonno)
    printVec2();
  else
    cout << -1 << "\n";
  return 0;
}
