Problem: On the way to school, Karen became fixated on the puzzle game on her phone!

<image>

The game is played as follows. In each level, you have a grid with n rows and m columns. Each cell originally contains the number 0.

One move consists of choosing one row or column, and adding 1 to all of the cells in that row or column.

To win the level, after all the moves, the number in the cell at the i-th row and j-th column should be equal to gi, j.

Karen is stuck on one level, and wants to know a way to beat this level using the minimum number of moves. Please, help her with this task!

Input

The first line of input contains two integers, n and m (1 ≤ n, m ≤ 100), the number of rows and the number of columns in the grid, respectively.

The next n lines each contain m integers. In particular, the j-th integer in the i-th of these rows contains gi, j (0 ≤ gi, j ≤ 500).

Output

If there is an error and it is actually not possible to beat the level, output a single integer -1.

Otherwise, on the first line, output a single integer k, the minimum number of moves necessary to beat the level.

The next k lines should each contain one of the following, describing the moves in the order they must be done:

  * row x, (1 ≤ x ≤ n) describing a move of the form "choose the x-th row". 
  * col x, (1 ≤ x ≤ m) describing a move of the form "choose the x-th column". 



If there are multiple optimal solutions, output any one of them.

Examples

Input

3 5
2 2 2 3 2
0 0 0 1 0
1 1 1 2 1


Output

4
row 1
row 1
col 4
row 3


Input

3 3
0 0 0
0 1 0
0 0 0


Output

-1


Input

3 3
1 1 1
1 1 1
1 1 1


Output

3
row 1
row 2
row 3

Note

In the first test case, Karen has a grid with 3 rows and 5 columns. She can perform the following 4 moves to beat the level:

<image>

In the second test case, Karen has a grid with 3 rows and 3 columns. It is clear that it is impossible to beat the level; performing any move will create three 1s on the grid, but it is required to only have one 1 in the center.

In the third test case, Karen has a grid with 3 rows and 3 columns. She can perform the following 3 moves to beat the level:

<image>

Note that this is not the only solution; another solution, among others, is col 1, col 2, col 3.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int dx[8] = {1, 0, 0, -1, 1, 1, -1, -1};
int dy[8] = {0, -1, 1, 0, -1, 1, -1, 1};
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool isprime[1000000 + 5];
void init_prime() {
  fill(isprime, isprime + 1000000 + 5, true);
  isprime[0] = isprime[1] = false;
  for (int i = (0), loop_end_i = (1000000 + 5); i < (loop_end_i); i++) {
    if (isprime[i]) {
      for (int j = i * 2; j < 1000000; j += i) {
        isprime[j] = false;
      }
    }
  }
}
vector<long long> factors(long long n) {
  vector<long long> v;
  for (long long i = (0), loop_end_i = (1000000); i < (loop_end_i); i++) {
    if (!isprime[i]) continue;
    while (n % i == 0) {
      v.push_back(i);
      n /= i;
    }
  }
  if (n > 1) {
    v.push_back(n);
  }
  return v;
}
template <typename T = int>
class bit {
 public:
  T *bit_arr;
  int size;
  bit(int n) {
    size = n;
    bit_arr = new T[n];
    fill(bit_arr, bit_arr + n, 0);
  }
  ~bit() { delete bit_arr; }
  T sum(int a) {
    T ret = 0;
    while (a) {
      ret += bit_arr[a];
      a -= a & -a;
    }
    return ret;
  }
  T sum(int a, int b) { return sum(b) - sum(a); }
  T get(int a) { return sum(a, a + 1); }
  void add(int a, T x) {
    a++;
    while (a < size) {
      bit_arr[a] += x;
      a += a & -a;
    }
  }
  void set(int a, T x) { add(a, x - get(a)); }
};
template <typename T = int, class Compare = less<T> >
class rmq {
 public:
  int size;
  Compare comp;
  T *dat;
  T init;
  rmq(int n, T init_ = INT_MAX) {
    init = init_;
    size = 1;
    while (size < n) size *= 2;
    dat = new T[2 * size - 1];
    fill(dat, dat + (2 * size - 1), init);
  }
  ~rmq() { delete dat; }
  void set(int k, T a) {
    k += size - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2], comp);
    }
  }
  T get(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) return init;
    if (a <= l && r <= b)
      return dat[k];
    else {
      T vl = get(a, b, k * 2 + 1, l, (l + r) / 2);
      T vr = get(a, b, k * 2 + 2, (l + r) / 2, r);
      return min(vl, vr, comp);
    }
  }
  T get(int a, int b) { return get(a, b, 0, 0, size); }
};
int n, m;
int g[105][105];
int rd[105], cd[105];
vector<int> rs, cs;
int main() {
  {
    scanf("%d", &(n));
    scanf("%d", &(m));
  };
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
    for (int j = (0), loop_end_j = (m); j < (loop_end_j); j++) {
      scanf("%d", &(g[i][j]));
    };
  for (int j = (0), loop_end_j = (m - 1); j < (loop_end_j); j++)
    cd[j + 1] = g[0][j + 1] - g[0][j];
  for (int i = (1), loop_end_i = (n); i < (loop_end_i); i++) {
    for (int j = (0), loop_end_j = (m - 1); j < (loop_end_j); j++) {
      if (cd[j + 1] != g[i][j + 1] - g[i][j]) goto ng;
    }
  }
  for (int i = (0), loop_end_i = (n - 1); i < (loop_end_i); i++)
    rd[i + 1] = g[i + 1][0] - g[i][0];
  for (int j = (1), loop_end_j = (m); j < (loop_end_j); j++) {
    for (int i = (0), loop_end_i = (n - 1); i < (loop_end_i); i++) {
      if (rd[i + 1] != g[i + 1][j] - g[i][j]) goto ng;
    }
  }
  for (int j = (0), loop_end_j = (m - 1); j < (loop_end_j); j++)
    cd[j + 1] += cd[j];
  int mi;
  mi = INT_MAX;
  for (int j = (0), loop_end_j = (m); j < (loop_end_j); j++)
    ((mi) = min((mi), (cd[j])));
  for (int j = (0), loop_end_j = (m); j < (loop_end_j); j++) cd[j] -= mi;
  for (int i = (0), loop_end_i = (n - 1); i < (loop_end_i); i++)
    rd[i + 1] += rd[i];
  mi = INT_MAX;
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++)
    ((mi) = min((mi), (rd[i])));
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++) rd[i] -= mi;
  int del;
  del = g[0][0] - cd[0] - rd[0];
  if (del < 0) goto ng;
  if (n < m) {
    for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++) {
      for (int k = (0), loop_end_k = (del); k < (loop_end_k); k++) {
        rs.push_back(i);
      }
    }
  } else {
    for (int j = (0), loop_end_j = (m); j < (loop_end_j); j++) {
      for (int k = (0), loop_end_k = (del); k < (loop_end_k); k++) {
        cs.push_back(j);
      }
    }
  }
  for (int i = (0), loop_end_i = (n); i < (loop_end_i); i++) {
    for (int k = (0), loop_end_k = (rd[i]); k < (loop_end_k); k++) {
      rs.push_back(i);
    }
  }
  for (int j = (0), loop_end_j = (m); j < (loop_end_j); j++) {
    for (int k = (0), loop_end_k = (cd[j]); k < (loop_end_k); k++) {
      cs.push_back(j);
    }
  }
  printf("%d\n", rs.size() + cs.size());
  for (int i : rs) {
    printf("row %d\n", i + 1);
  }
  for (int j : cs) {
    printf("col %d\n", j + 1);
  }
  return 0;
ng:
  printf("-1\n");
  return 0;
}