#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
signed main() {
  if (!false) {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
  int N, M;
  scanf("%d%d", &N, &M);
  vector<vector<int>> g(N, vector<int>(M));
  vector<int> m(N, INT_MAX), k(M, INT_MAX);
  for (int _i = (N), i = (0); i < _i; i++)
    for (int _j = (M), j = (0); j < _j; j++) {
      scanf("%d", &g[i][j]);
      m[i] = min(m[i], g[i][j]);
      k[j] = min(k[j], g[i][j]);
    }
  for (int _i = (N), i = (1); i < _i; i++)
    for (int _j = (M), j = (1); j < _j; j++)
      if (g[0][0] - g[0][j] != g[i][0] - g[i][j]) {
        printf("-1\n");
        return 0;
      }
  int ans = 0, kin = 0;
  for (int _i = (N), i = (0); i < _i; i++)
    for (int _j = (m[i]), j = (0); j < _j; j++) ++ans;
  for (int _i = (M), i = (0); i < _i; i++)
    for (int _j = (g[0][i] - m[0]), j = (0); j < _j; j++) ++ans;
  for (int _i = (M), i = (0); i < _i; i++)
    for (int _j = (k[i]), j = (0); j < _j; j++) ++kin;
  for (int _i = (N), i = (0); i < _i; i++)
    for (int _j = (g[i][0] - k[0]), j = (0); j < _j; j++) ++kin;
  if (ans < kin) {
    printf("%d\n", ans);
    for (int _i = (N), i = (0); i < _i; i++)
      for (int _j = (m[i]), j = (0); j < _j; j++) printf("row %d\n", i + 1);
    for (int _i = (M), i = (0); i < _i; i++)
      for (int _j = (g[0][i] - m[0]), j = (0); j < _j; j++)
        printf("col %d\n", i + 1);
  } else {
    printf("%d\n", kin);
    for (int _i = (M), i = (0); i < _i; i++)
      for (int _j = (k[i]), j = (0); j < _j; j++) printf("col %d\n", i + 1);
    for (int _i = (N), i = (0); i < _i; i++)
      for (int _j = (g[i][0] - k[0]), j = (0); j < _j; j++)
        printf("row %d\n", i + 1);
  }
  return 0;
}
