Towers of Hanoi
Execution time limit is 3 seconds
Runtime memory usage limit is 128 megabytes
Three pegs are given. The first peg contains some disks in ascending order of their size from top to bottom. The other two pegs are empty. You must move all disks from the first peg to the second. You can move each time only one disk. It is not allowed to put a larger disk on a smaller one.
Input
The number of disks on the first peg.
Output
In each line print two numbers — the peg numbers from which and where the disk is moved. The solution must be the shortest.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 63%