#P1421C. Palindromifier
Palindromifier
No submission language available for this problem.
Description
Ringo found a string of length in his yellow submarine. The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn the string into a palindrome by applying two types of operations to the string.
The first operation allows him to choose () and to append the substring ( characters) reversed to the front of .
The second operation allows him to choose () and to append the substring ( characters) reversed to the end of .
Note that characters in the string in this problem are indexed from .
For example suppose abcdef. If he performs the first operation with then he appends cb to the front of and the result will be cbabcdef. Performing the second operation on the resulted string with will yield cbabcdefedc.
Your task is to help Ringo make the entire string a palindrome by applying any of the two operations (in total) at most times. The length of the resulting palindrome must not exceed
It is guaranteed that under these constraints there always is a solution. Also note you do not have to minimize neither the number of operations applied, nor the length of the resulting string, but they have to fit into the constraints.
The only line contains the string () of lowercase letters from the English alphabet.
The first line should contain () — the number of operations performed.
Each of the following lines should describe an operation in form L i or R i. represents the first operation, represents the second operation, represents the index chosen.
The length of the resulting palindrome must not exceed .
Input
The only line contains the string () of lowercase letters from the English alphabet.
Output
The first line should contain () — the number of operations performed.
Each of the following lines should describe an operation in form L i or R i. represents the first operation, represents the second operation, represents the index chosen.
The length of the resulting palindrome must not exceed .
Samples
Note
For the first example the following operations are performed:
abac abacab abacaba
The second sample performs the following operations: acccc cccacccc ccccacccc
The third example is already a palindrome so no operations are required.