#include<iostream> usingnamespace std; int n, m, p, q, top, f, a[101][101], ans[100001], mode[100001]; boolcheck(int t, int mode){ if (!mode) { for (int i = 1; i <= m; ++i) if (!a[t][i]) returnfalse; for (int i = 1; i <= m; ++i) --a[t][i]; returntrue; } else { for (int i = 1; i <= n; ++i) if (!a[i][t]) returnfalse; for (int i = 1; i <= n; ++i) --a[i][t]; returntrue; } } intmain() { cin >> n >> m; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { cin >> a[i][j]; } } p = n, q = m; if (p > q) { p ^= q ^= p ^= q; f = 1; } for (int i = 1; i <= p; ++i) while (check(i, f)) { ans[++top] = i; mode[top] = f; } for (int i = 1; i <= q; ++i) while (check(i, !f)) { ans[++top] = i; mode[top] = !f; } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { if (a[i][j]) { cout << -1 << endl; return0; } } } cout << top << endl; for (int i = 1; i <= top; ++i) { if (!mode[i]) cout << "row "; else cout << "col "; cout << ans[i] << endl; } return0; }