Task
Davide purchased books in preparation for the new academic year. He carefully placed them on a table in his study room.
After a few minutes, he noticed that the books were arranged in ascending order, with the smallest book at the bottom and the largest book at the top.
Realizing this, Davide decided that he preferred the books to be in a different order.
He wants to reverse their position, so the largest book is at the bottom and the smallest book is at the top.
Davide can perform the following operation a maximum of times: he can remove books from the top of pile and place them, in the same order, on top of pile (he may choose to utilize a new empty pile, if desired).
The cost of the operation will be if the movement of books results in pile having less books than pile prior to the movement, and otherwise.
Help Davide to reverse the order of the books while minimizing the total cost.
Input
The first line contains the only integer , the number of books.
Your program will be tested against several test cases grouped in subtasks. The
score in each subtask will be calculated as the minimum score obtained in any of
its test cases, multiplied by the value of the subtask.
The score of a test case is if the answer is wrong or invalid, otherwise let be the total cost of the operations performed by your program. It can be proved that with the given constraints the minimal cost is at least , and a solution always exists with at most operations.
Your score will be calculated based on the following formula:
score = .
Output
For each operation, output a line containing three integers , and .
Example 1
stdin
3
stdout
1 0 1
1 0 2
1 0 3
1 1 0
1 2 0
1 3 0
Example 2
stdin
4
stdout
1 0 1
1 0 1
1 0 2
1 0 2
2 2 1
Explanation
In the first sample case initially there are books on pile .
We perform the following operations:
- Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
Finally, we have books on pile in the correct order, with a total cost of .
Note that for books there exists a solution with cost , too, however according to the scoring formula, the solution with cost gets a full score as well.
In the second sample case initially there are books on pile .
We perform the following operations:
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move book from pile to pile with cost .
-
Move books from pile to pile with cost .
Finally, we have books on pile in the correct order, with a total cost of .