#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int G[maxn][maxn];
int row[maxn], col[maxn];
int main() {
  int n, m;
  while (cin >> n >> m) {
    int ans = 0;
    bool rev = false, flag = true;
    memset(row, 0, sizeof(row));
    memset(col, 0, sizeof(col));
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> G[i][j];
    if (n > m) {
      rev = true;
      for (int i = 0; i < n; i++)
        for (int j = 0; j < i; j++) swap(G[i][j], G[j][i]);
      swap(n, m);
    }
    for (int i = 0; i < n; i++) {
      int minn = 0x3f3f3f3f;
      for (int j = 0; j < m; j++) {
        minn = min(minn, G[i][j]);
      }
      if (minn) row[i] = minn, ans += minn;
      for (int j = 0; j < m; j++) G[i][j] -= minn;
    }
    for (int j = 0; j < m; j++) {
      int minn = 0x3f3f3f3f;
      for (int i = 0; i < n; i++) {
        minn = min(minn, G[i][j]);
      }
      if (minn) col[j] = minn, ans += minn;
      for (int i = 0; i < n; i++) {
        G[i][j] -= minn;
        if (G[i][j]) {
          flag = false;
          break;
        }
      }
    }
    if (flag) {
      cout << ans << endl;
      for (int i = 0; i < n; i++)
        while (row[i]--) cout << (rev ? "col" : "row") << ' ' << i + 1 << endl;
      for (int j = 0; j < m; j++)
        while (col[j]--) cout << (rev ? "row" : "col") << ' ' << j + 1 << endl;
    } else
      cout << -1 << endl;
  }
  return 0;
}
