|| ||Code Submission Evaluation System
Tasks | Scoreboard | Statistics
CSES - Datatähti Open 2018 - StringCSES - String
|Time limit:||1.00 s|
|Memory limit:||512 MB|
You are given a string that contains each letter A–Z exactly once.
There are two possible operations:
SWAP: swap the first two letters of the string
MOVE: move the last letter to the front of the string
Your task is to find a sequence of operations after which the letters of the string are in increasing order.
The only input line contains the string.
First print an integer $k$: the number of operations. After this, print $k$ lines, each of which contains one of the operations
You can print any solution as long as $k \le 10^5$. There is always a solution.
You will get 100 points if your program solves all test cases; otherwise you will get 0 points.