The Last Eye
After the great battle, which the indigenous people won against the conquistadors, the commanders of the indigenous army decided to hold a military parade in their capital. Columns of troops were to march before the line of commanders, showcasing their might and strength to all. This parade was intended to significantly boost the morale of the troops and prepare them for future battles.
The only challenge in organizing the parade was that among all the commanders, only the Last Eye retained his sight. It was decided to line up all the commanders in formation, after which the Last Eye would arrange the other commanders by height. However, according to the drill regulations, the Last Eye's actions are limited: he can either swap places with his neighbor or swap two of his neighbors with each other.
The Last Eye is concerned that he might not manage such a crucial task, especially with higher-ranking military personnel in the formation, so he has decided to entrust this task to you.
Input
The first line of the input file contains the numbers N and K - the number of commanders and the position of the Last Eye in the formation, respectively (1 ≤ K ≤ N ≤ 500). The next line contains the numbers a_i - the height in centimeters of the commander standing i-th in order from left to right in the formation (150 ≤ a_i ≤ 240).
Output
The output file should contain the sequence of commands that, when executed, will allow the Last Eye to arrange all the commanders in order of increasing height.
The following commands are possible for the Last Eye:
"left" - swap with the neighbor on the left;
"right" - swap with the neighbor on the right;
"swap" - swap the neighbors with each other.
Commands should be output one per line, without spaces. The sequence of commands should end with the line "sorted". If it is impossible to rearrange the commanders by height in this way, output the answer "impossible".