Just like all math-loving students, Bobo loves squares, especially big ones, and he loves to combine many small squares into a big one. “Exactly. That's why I drew squares on my algebra exam,” Bobo explained to his algebra professor.

Algebraically,right?
Because of this, Bobo is also interested in perfect squared squares, which are squares that can be dissected into smaller squares of different sizes. The smallest order for a perfect squared square is 21, discovered by A. J. W. Duijvestijn.

Perfect Squared square of order 21
However, it's too difficult for Bobo to assemble squares of different sizes into a big square, so he wants to start with something simpler, like assembling

small squares with side length

into a big square with side length

. Of course, Bobo cannot use only one operation to assemble all the squares together, or it would be too boring. He now has a new requirement: the number of squares merged each time must be between 2 and 50 (inclusive), and the resulting shape must still be a square.
Bobo doesn't know how to proceed, so he has given this problem to you. It is guaranteed that under the constraint of this problem, a valid sequence of operations always exists.
输入描述:
The only line contains an integer
, denoting the number of rows and columns of the small squares.
输出描述:
Output a number
in the first line, representing the number of operations. In the next
lines, output three numbers
,
and
per line, representing one operation. Here,
and
represent the row number and column number of the upper-left corner of the merged large square after this operation (
is used to represent the row number and column number), and
represents the side length of the merged large square. You need to ensure that each of your operations satisfies the following conditions:
1. 
2. The square with side length
whose upper-left corner is in cell
contains only complete squares, and the number of squares is between
and
.
You also need to ensure that after all the operations are completed, all
small squares with a side length of
will be pieced together to form a large square with a side length of
. If there are multiple valid sequence of operations, you may output any of it. Refer to the notes section for more information.
示例3
输出
复制
5
1 1 4
1 5 4
5 1 4
5 5 4
1 1 8
备注:
To aid understanding, we provide graphical illustrations for the third sample test. The merging process in the solution for the third example is shown below (purple represents the area merged each time).