#include <bits/stdc++.h>
using namespace std;
const int MX = 100;
int arr[MX][MX];
int Min[2][MX];
int n, m;
int cnt;
bool x;
void Swap(int n, int m) {
  if (n > m) {
    int c = m;
    m = n;
    n = c;
  }
}
void Scan() {
  if (n > m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> arr[j][i];
    Swap(n, m);
  } else
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> arr[i][j];
}
void Value() {
  for (int i = 0; i < n; i++) Min[0][i] = 501;
  for (int j = 0; j < m; j++) Min[1][j] = 501;
}
void Find_Min_R() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) Min[0][i] = min(Min[0][i], arr[i][j]);
    cnt += Min[0][i];
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) arr[i][j] -= Min[0][i];
}
void Find_Min_C() {
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) Min[1][j] = min(Min[1][j], arr[i][j]);
    cnt += Min[1][j];
  }
}
bool Check() {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (arr[i][j] > Min[1][j]) return false;
  return true;
}
void Print() {
  if (n > m) {
    int c = m;
    m = n;
    n = c;
  }
  cout << cnt << endl;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < Min[0][i]; j++)
      if (x == true) {
        cout << "col ";
        cout << i + 1 << endl;
      } else
        cout << "row " << i + 1 << endl;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < Min[1][j]; i++)
      if (x == true) {
        cout << "row ";
        cout << j + 1 << endl;
      } else
        cout << "col " << j + 1 << endl;
}
int main() {
  cin >> n >> m;
  Scan();
  if (n > m) {
    int c = m;
    m = n;
    n = c;
    x = true;
  }
  Value();
  Find_Min_R();
  Find_Min_C();
  if (Check() == true)
    Print();
  else
    return cout << -1, 0;
}
