You have an grid. Each cell contains an integer. The number at the
-th row and
-th column has initial value
.
In one operation you can choose a cell and an integer
such that
and do the following:
The first line contains a single integer.
The nextlines each contains
integers. The
-th integer on the
-th line is
.
If your goal cannot be achieved, print one integerin a line.
Otherwise print integerin the first line, indicating the number of operations. Then print
lines. Each line contains three integers
separated by a single space, indicating one operation. You must make sure
.