#bzoj2214. Shift
Shift
Title Description
bought his son a set of blocks numbered from to and arranged them in a row in a certain order. 's goal is to rearrange the blocks so that they are ordered naturally, from the smallest number to the largest. However, the only moves is allowed to make are: putting the last block at the very beginning (move ), and putting the third block at the very beginning (move ). Help by writing a program that tells whether a given arrangement of blocks can be properly reordered, and tells the right sequence of moves if it is.
Input format
In the first line of the standard input there is a single integer . In the second line there are integers from the range to , separated by single spaces. No number appears twice, and thus they represent the initial arrangement of the blocks. .
Output format

Sample
4
1 3 2 4
4
3a 2b 2a 2b
7
1 3 2 4 5 6 7
NIE DA SIE
3
1 2 3
0
Data scope and agreement
For of the data:.