Railroad sorting

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Arsenii works as an operator at a sorting station, the scheme of which is shown on the image.

The station has an input track, an output track and two dead ends. The operator can move cars between tracks and dead ends.

If car xx is the first car on the input track, this car can be moved to any dead end. Command "1" moves the car to the dead end 11, and command "2" moves car to the dead end 22.

If the car xx is the closest car to the exit in one of the dead ends, it can be moved to output track. Command "-1" moves the car from the dead end 11, and command "-2" moves the car from the dead end 22.

Finally, you can move cars between dead ends. If xx is the closest car to the exit in one of the dead ends, it can be moved to another dead end. Command "12" moves the car from the dead end 11 to the dead end 22, and the command "21" moves the car from the dead end 22 to the dead end 11.

Please note that cars cannot be returned to a dead end from the output track and cannot be returned from a dead end to the input track. Also, you cannot move the car directly from the input track to the output track, it is required to use a dead end. Both dead ends can contain any number of cars.

A train of nn cars arrives on the input track, each car has a unique number from 11 to nn.

Arsenii must sort the cars so that they are all on the output track and their numbers from left to right are in ascending order. Help him form a sequence of commands that will help him to achieve this. The number of commands in the sequence must not be exceed 21062 \cdot 10^6.

입력

The first line of input contains integer nn --- the number of cars (1n10001 \le n \le 1000).

The second line contains nn different integers a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n (1a_in1 \le a\_i \le n) --- the numbers on the cars in order from left to right on the input track.

출력

Print the sequence of commands that will cause the cars to be on the output track, and their numbers would be in ascending order. The sequence must contain no more than 21062 \cdot 10^6 command.

If there are multiple correct sequences, you can output any of them.

It is guaranteed that for any input data there is a sequence of commands containing at most 21062 \cdot 10^6 commands.