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 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 , and command "2" moves car to the dead end .
If the car 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 , and command "-2" moves the car from the dead end .
Finally, you can move cars between dead ends. If 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 to the dead end , and the command "21" moves the car from the dead end to the dead end .
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 cars arrives on the input track, each car has a unique number from to .
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 .
입력
The first line of input contains integer --- the number of cars ().
The second line contains different integers () --- 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 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 commands.