#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int A[n][m];
  int B[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> A[i][j];
      B[i][j] = 0;
    }
  }
  if (m >= n) {
    vector<string> ans_1;
    vector<int> ans_12;
    for (int i = 0; i < n; i++) {
      int nim = 1e6, in1 = -1, in2 = -1;
      for (int j = 0; j < m; j++) {
        if (A[i][j] < nim) {
          nim = A[i][j];
          in1 = i;
          in2 = j;
        }
      }
      nim = A[in1][in2] - B[in1][in2];
      if (nim > 0 && B[in1][in2] < A[in1][in2]) {
        char q = i + 1;
        int t = 0;
        while (t < nim) {
          ans_1.push_back("row ");
          ans_12.push_back(q);
          t++;
        }
        for (int j = 0; j < m; j++) {
          B[i][j] += nim;
        }
      }
    }
    for (int i = 0; i < m; i++) {
      int nim = 1e6, in1 = -1, in2 = -1;
      for (int j = 0; j < n; j++) {
        if (A[j][i] < nim) {
          nim = A[j][i];
          in1 = j;
          in2 = i;
        }
      }
      nim = A[in1][in2] - B[in1][in2];
      if (nim > 0 && B[in1][in2] < A[in1][in2]) {
        char q = i + 1;
        int t = 0;
        while (t < nim) {
          ans_1.push_back("col ");
          ans_12.push_back(q);
          t++;
        }
        for (int j = 0; j < n; j++) {
          B[j][i] += nim;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (A[i][j] != B[i][j]) {
          cout << -1;
          return 0;
        }
      }
    }
    cout << ans_1.size() << "\n";
    for (int i = 0; i < ans_1.size(); i++) {
      cout << ans_1[i] << ans_12[i];
      if (i != ans_1.size() - 1) {
        cout << "\n";
      }
    }
  } else {
    vector<string> ans_1;
    vector<int> ans_12;
    for (int i = 0; i < m; i++) {
      int nim = 1e6, in1 = -1, in2 = -1;
      for (int j = 0; j < n; j++) {
        if (A[j][i] < nim) {
          nim = A[j][i];
          in1 = j;
          in2 = i;
        }
      }
      nim = A[in1][in2] - B[in1][in2];
      if (nim > 0 && B[in1][in2] < A[in1][in2]) {
        char q = i + 1;
        int t = 0;
        while (t < nim) {
          ans_1.push_back("col ");
          ans_12.push_back(q);
          t++;
        }
        for (int j = 0; j < n; j++) {
          B[j][i] += nim;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      int nim = 1e6, in1 = -1, in2 = -1;
      for (int j = 0; j < m; j++) {
        if (A[i][j] < nim) {
          nim = A[i][j];
          in1 = i;
          in2 = j;
        }
      }
      nim = A[in1][in2] - B[in1][in2];
      if (nim > 0 && B[in1][in2] < A[in1][in2]) {
        char q = i + 1;
        int t = 0;
        while (t < nim) {
          ans_1.push_back("row ");
          ans_12.push_back(q);
          t++;
        }
        for (int j = 0; j < m; j++) {
          B[i][j] += nim;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (A[i][j] != B[i][j]) {
          cout << -1;
          return 0;
        }
      }
    }
    cout << ans_1.size() << "\n";
    for (int i = 0; i < ans_1.size(); i++) {
      cout << ans_1[i] << ans_12[i];
      if (i != ans_1.size() - 1) {
        cout << "\n";
      }
    }
  }
  return 0;
}
