Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. In this task we consider the version where each square has a different colour. A sheet configuration is given by the sequence of colours obtained by reading the colours of the squares starting at the upper left corner and going in clockwise direction. This configuration is the initial configuration.
All configurations are available using the three basic transformations.
Numbers outside the squares denote square positions. If a square in position p contains number i , it means that after applying the transformation, the square whose position was i before the transformation moves to position p . On the following L lines it must write the sequence of identifiers of basic transformations, one letter in the first position of each line.