Crane

Time limit1sMemory limit128 MB

Problem

There are N open boxes arranged in a row from left to right. Each box contains exactly two balls, and each ball is either white or black.

At first, a crane is above the leftmost box. You can control the crane with these commands.

  • LIJEVO: move the crane to the adjacent box on the left.
  • DESNO: move the crane to the adjacent box on the right.
  • UZMI BIJELU: take one white ball from the current box.
  • UZMI CRNU: take one black ball from the current box.
  • SPUSTI BIJELU: drop one white ball into the current box.
  • SPUSTI CRNU: drop one black ball into the current box.

The crane can hold at most two balls at the same time. There is no limit on how many balls a box may contain during the process.

The balls are sorted when all of the following conditions hold.

  • Each box contains exactly two balls of the same color.
  • Between any two boxes that contain two white balls, there is no box that contains two black balls.
  • Between any two boxes that contain two black balls, there is no box that contains two white balls.

Output a shortest possible sequence of commands that sorts the balls.

Every command in your output must be executable. For example, the crane cannot move left from the leftmost box, and it cannot hold more than two balls.

Input

The first line contains an integer N. 2 ≤ N ≤ 500.

The second line contains N strings describing the boxes from left to right.

Each string has length 2, and each character is B or C. B denotes a white ball, and C denotes a black ball.

Output

Print all commands, one per line.

There may be more than one shortest valid command sequence, but every input is guaranteed to be sortable.