#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  long long a[n][m], c[n][m];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) cin >> a[i][j];
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      c[i][j] = a[i][j];
    }
  }
  vector<long long> row, col, row1, col1;
  for (long long i = 0; i < n; i++) {
    long long mn = 501;
    for (long long j = 0; j < m; j++) {
      if (a[i][j] < mn) mn = a[i][j];
    }
    for (long long k = 0; k < mn; k++) {
      row.push_back(i + 1);
    }
    for (long long j = 0; j < m; j++) {
      a[i][j] = a[i][j] - mn;
    }
  }
  for (long long i = 0; i < m; i++) {
    long long mn = 501;
    for (long long j = 0; j < n; j++) {
      if (a[j][i] < mn) mn = a[j][i];
    }
    for (long long k = 0; k < mn; k++) col.push_back(i + 1);
    for (long long j = 0; j < n; j++) {
      a[j][i] = a[j][i] - mn;
    }
  }
  long long flag = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  if (flag == 1)
    cout << "-1";
  else {
    for (long long i = 0; i < m; i++) {
      long long mn = 501;
      for (long long j = 0; j < n; j++) {
        if (c[j][i] < mn) mn = c[j][i];
      }
      for (long long k = 0; k < mn; k++) col1.push_back(i + 1);
      for (long long j = 0; j < n; j++) {
        c[j][i] = c[j][i] - mn;
      }
    }
    for (long long i = 0; i < n; i++) {
      long long mn = 501;
      for (long long j = 0; j < m; j++) {
        if (c[i][j] < mn) mn = c[i][j];
      }
      for (long long k = 0; k < mn; k++) {
        row1.push_back(i + 1);
      }
      for (long long j = 0; j < m; j++) {
        c[i][j] = c[i][j] - mn;
      }
    }
    if (row.size() + col.size() <= row1.size() + col1.size()) {
      cout << row.size() + col.size() << "\n";
      if (row.size() + col.size() == 0) return;
      for (long long i = 0; i < row.size(); i++)
        cout << "row"
             << " " << row[i] << "\n";
      for (long long i = 0; i < col.size(); i++)
        cout << "col"
             << " " << col[i] << "\n";
    } else {
      cout << row1.size() + col1.size() << "\n";
      if (row1.size() + col1.size() == 0) return;
      for (long long i = 0; i < row1.size(); i++)
        cout << "row"
             << " " << row1[i] << "\n";
      for (long long i = 0; i < col1.size(); i++)
        cout << "col"
             << " " << col1[i] << "\n";
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
