#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k, a[505][505];
  int mini, ans, ans2, minii[505], req[505], flag, flag2, flag3, minimum_pos,
      needed;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < m; i++) {
    mini = a[0][i];
    for (j = 0; j < n; j++) {
      mini = min(mini, a[j][i]);
    }
    minii[i] = mini;
  }
  ans = 1e9;
  for (i = 0; i <= 500; i++) {
    ans2 = i;
    flag = 0;
    flag3 = 0;
    for (j = 0; j < m; j++) {
      if (i > a[0][j]) {
        flag = 1;
        break;
      }
      req[j] = a[0][j] - i;
      if (req[j] > minii[j]) {
        flag3 = 1;
        break;
      }
      ans2 += req[j];
    }
    if (flag) {
      break;
    }
    if (flag3) {
      continue;
    }
    flag2 = 0;
    for (j = 1; j < n; j++) {
      for (k = 0; k < m; k++) {
        if (k == 0) {
          if (a[j][k] < req[k]) {
            flag2 = 1;
            break;
          } else {
            needed = a[j][k] - req[k];
          }
        } else {
          if (needed != (a[j][k] - req[k])) {
            flag2 = 1;
            break;
          }
        }
      }
      if (flag2) {
        break;
      } else {
        ans2 += needed;
      }
    }
    if (flag2) {
      continue;
    }
    if (ans > ans2) {
      ans = ans2;
      minimum_pos = i;
    }
  }
  if (ans == 1e9) {
    cout << -1;
  } else {
    cout << ans << "\n";
    for (i = 0; i < minimum_pos; i++) {
      cout << "row " << 1 << "\n";
    }
    for (j = 0; j < m; j++) {
      req[j] = a[0][j] - minimum_pos;
      for (k = 0; k < a[0][j] - minimum_pos; k++) {
        cout << "col " << j + 1 << "\n";
      }
    }
    for (i = 1; i < n; i++) {
      for (j = 0; j < a[i][0] - req[0]; j++) {
        cout << "row " << i + 1 << "\n";
      }
    }
  }
}
