#include <bits/stdc++.h>
using namespace std;
int dr[] = {0, 1, 0, -1};
int dc[] = {1, 0, -1, 0};
vector<pair<int, int> > v;
int g[110][110];
int row[110];
int col[110];
int row1[110];
int col1[110];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) scanf("%d", &g[i][j]);
  }
  int sum = 0, sum1 = 0;
  for (int i = 0; i < n; ++i) {
    int mn = 501;
    for (int j = 0; j < m; ++j) {
      mn = min(mn, g[i][j]);
    }
    row[i] = mn;
    sum += row[i];
  }
  for (int j = 0; j < m; ++j) {
    int mn = 501;
    for (int i = 0; i < n; ++i) {
      mn = min(mn, g[i][j] - row[i]);
    }
    col[j] = mn;
    sum += col[j];
  }
  bool ans = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (col[j] + row[i] != g[i][j]) ans = false;
    }
  }
  for (int j = 0; j < m; ++j) {
    int mn = 501;
    for (int i = 0; i < n; ++i) {
      mn = min(mn, g[i][j]);
    }
    col1[j] = mn;
    sum1 += col1[j];
  }
  for (int i = 0; i < n; ++i) {
    int mn = 501;
    for (int j = 0; j < m; ++j) {
      mn = min(mn, g[i][j] - col1[j]);
    }
    row1[i] = mn;
    sum1 += row1[i];
  }
  bool ans1 = true;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (col1[j] + row1[i] != g[i][j]) ans1 = false;
    }
  }
  if (ans1 && sum1 < sum) {
    printf("%d\n", sum1);
    for (int i = 0; i < n; ++i)
      while (row1[i] > 0) {
        printf("row %d\n", i + 1);
        row1[i]--;
      }
    for (int i = 0; i < m; ++i)
      while (col1[i] > 0) {
        printf("col %d\n", i + 1);
        col1[i]--;
      }
  } else if (ans) {
    printf("%d\n", sum);
    for (int i = 0; i < n; ++i)
      while (row[i] > 0) {
        printf("row %d\n", i + 1);
        row[i]--;
      }
    for (int i = 0; i < m; ++i)
      while (col[i] > 0) {
        printf("col %d\n", i + 1);
        col[i]--;
      }
  } else
    puts("-1");
}
