A while ago, Mirko's grandparents had to switch from analog to digital TV receiver. On their old analog receiver they could watch only two channels: BLJTV1 and BLJTV2. Switching to digital receiver they gained dozens of new channels, but they still wanted to watch just the two channels they had before. They asked Mirko to adjust the remote control in a way that BLJTV1 is on first and BLJTV2 on the second key.
When switched on, digital receiver creates a list of available channels. All of the channels are distinct and the list always contains BLJTV1 and BLJTV2. Mirko found the remote and he started adjusting the receiver. Menu contains the channel list and a little arrow which is marking the currently selected channel. After entering the menu, the arrow is marking the first channel on the list.
There are four operations in the menu, denoted with numbers to :
- move the arrow one place down (from channel to channel )
- move the arrow one place up (from channel to channel )
- move the arrow and selected channel one place down (channel and channel are switching places, arrow ends up in place )
- move the arrow and selected channel one place up (channel and channel are switching places, arrow ends up in place )
Menu is robust, so invalid commands (such as a command which would move the arrow outside of the channel list) are just ignored.
Write a program which will, given a channel list, output a sequence of any operations such that, after they are executed, BLJTV1 will be on the first, and BLJTV2 on the second place in channel list. Additionally, the sequence length should be less than . Ordering of all other channels is arbitrary.
Input Specification
First line of input contains a positive integer , number of channels.
Next lines contain a list of channels generated by the digital receiver. Each line contains the name of one channel. Channel name is a sequence of at most characters - capital letters of English alphabet and digits.
Input sequence is created in such way that it will always be required to make at least one operation.
Output Specification
First and only line of output should contain the sequence of Mirko's commands with no spaces in between.
Sample Input 1
3
ABC
BLJTV1
BLJTV2
Sample Output 1
33
Sample Input 2
4
ABC1
ABC02
BLJTV2
BLJTV1
Sample Output 2
11144411144
Sample Input 3
4
ABC1
ABC02
BLJTV2
BLJTV1
Sample Output 3
33144413
Comments