Repair in Hanoi#2170

Repair in Hanoi

1 second
128 megabytes
Very easy

By UNESCO resolution, the original Tower of Hanoi was subjected to restoration. Therefore, during the solution of the puzzle, it is forbidden to move a disk from the first peg directly to the third peg and vice versa. Write a recursive procedure that prints a sequence of moves subject to such restrictions.

Input

One integer (1 \leq n \leq 7)—the number of disks on the first peg.

Output

Print the sequence of moves for transferring all the rings to the third peg in the following format: number of the disk, starting peg, destination peg. Disks are numbered from the smallest to the largest. The number of moves must not exceed 10^5.

Examples

Example 1

Loading
Loading