On the way to school, Karen became fixated on the puzzle game on her phone!
<center></center>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 _g__i_, _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 _g__i_, _j_ (0 ≤ _g__i_, _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.
[samples]
## 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:
<center></center>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:
<center></center>Note that this is not the only solution; another solution, among others, is _col 1_, _col 2_, _col 3_.
在去学校的路上,Karen 被她手机上的拼图游戏吸引了!
游戏规则如下:在每一关中,你有一个包含 #cf_span[n] 行和 #cf_span[m] 列的网格。每个单元格最初包含数字 #cf_span[0]。
一步操作包括选择一行或一列,并将该行或列中的所有单元格的值增加 #cf_span[1]。
要赢得该关卡,在所有操作完成后,位于第 #cf_span[i] 行和第 #cf_span[j] 列的单元格中的数字必须等于 #cf_span[gi, j]。
Karen 在某一关卡上卡住了,她想知道如何用最少的步数通过这一关。请帮她解决这个问题!
输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m](#cf_span[1 ≤ n, m ≤ 100]),分别表示网格的行数和列数。
接下来的 #cf_span[n] 行,每行包含 #cf_span[m] 个整数。特别地,第 #cf_span[i] 行中的第 #cf_span[j] 个整数为 #cf_span[gi, j](#cf_span[0 ≤ gi, j ≤ 500])。
如果存在错误,导致该关卡实际上无法通过,请输出单个整数 _-1_。
否则,在第一行输出一个整数 #cf_span[k],表示通过该关卡所需的最少步数。
接下来的 #cf_span[k] 行,每行应输出以下格式之一,按操作顺序描述每一步:
如果有多个最优解,输出其中任意一个即可。
在第一个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[5] 列的网格。她可以通过以下 #cf_span[4] 步操作通过该关卡:
在第二个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[3] 列的网格。显然无法通过该关卡;执行任何操作都会在网格上产生三个 #cf_span[1],但题目要求中心位置只有一个 #cf_span[1]。
在第三个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[3] 列的网格。她可以通过以下 #cf_span[3] 步操作通过该关卡:
请注意,这并非唯一解;其他解之一是 _col 1_、_col 2_、_col 3_。
## Input
输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m](#cf_span[1 ≤ n, m ≤ 100]),分别表示网格的行数和列数。接下来的 #cf_span[n] 行,每行包含 #cf_span[m] 个整数。特别地,第 #cf_span[i] 行中的第 #cf_span[j] 个整数为 #cf_span[gi, j](#cf_span[0 ≤ gi, j ≤ 500])。
## Output
如果存在错误,导致该关卡实际上无法通过,请输出单个整数 _-1_。否则,在第一行输出一个整数 #cf_span[k],表示通过该关卡所需的最少步数。接下来的 #cf_span[k] 行,每行应输出以下格式之一,按操作顺序描述每一步:
_row_ #cf_span[x],(#cf_span[1 ≤ x ≤ n])表示选择第 #cf_span[x] 行的操作。
_col_ #cf_span[x],(#cf_span[1 ≤ x ≤ m])表示选择第 #cf_span[x] 列的操作。
如果有多个最优解,输出其中任意一个即可。
[samples]
## Note
在第一个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[5] 列的网格。她可以通过以下 #cf_span[4] 步操作通过该关卡:
在第二个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[3] 列的网格。显然无法通过该关卡;执行任何操作都会在网格上产生三个 #cf_span[1],但题目要求中心位置只有一个 #cf_span[1]。
在第三个测试用例中,Karen 拥有一个包含 #cf_span[3] 行和 #cf_span[3] 列的网格。她可以通过以下 #cf_span[3] 步操作通过该关卡:
请注意,这并非唯一解;其他解之一是 _col 1_、_col 2_、_col 3_。
**Definitions**
Let $ n, m \in \mathbb{Z}^+ $ denote the number of rows and columns, respectively.
Let $ G = (g_{i,j}) \in \mathbb{Z}^{n \times m} $ be the target grid, where $ 0 \le g_{i,j} \le 500 $.
Let $ r_i \in \mathbb{Z}_{\ge 0} $ denote the number of times row $ i $ is incremented.
Let $ c_j \in \mathbb{Z}_{\ge 0} $ denote the number of times column $ j $ is incremented.
**Constraints**
For all $ i \in \{1, \dots, n\} $, $ j \in \{1, \dots, m\} $:
$$
g_{i,j} = r_i + c_j
$$
**Objective**
Minimize the total number of moves:
$$
\sum_{i=1}^n r_i + \sum_{j=1}^m c_j
$$
subject to the above constraints.
If no non-negative integer solution $ (r_1, \dots, r_n, c_1, \dots, c_m) $ exists, output $-1$.
Otherwise, output the minimal sequence of moves (row/column increments) achieving the solution.