{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eRingo found a string $$$s$$$ of length $$$n$$$ in his \u003ca href\u003d\"https://www.youtube.com/watch?v\u003dm2uTFF_3MaA\"\u003eyellow submarine\u003c/a\u003e. The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn the string $$$s$$$ into a palindrome by applying two types of operations to the string. \u003c/p\u003e\u003cp\u003eThe first operation allows him to choose $$$i$$$ ($$$2 \\le i \\le n-1$$$) and to append the substring $$$s_2s_3 \\ldots s_i$$$ ($$$i - 1$$$ characters) reversed to the front of $$$s$$$.\u003c/p\u003e\u003cp\u003eThe second operation allows him to choose $$$i$$$ ($$$2 \\le i \\le n-1$$$) and to append the substring $$$s_i s_{i + 1}\\ldots s_{n - 1}$$$ ($$$n - i$$$ characters) reversed to the end of $$$s$$$.\u003c/p\u003e\u003cp\u003eNote that characters in the string in this problem are indexed from $$$1$$$.\u003c/p\u003e\u003cp\u003eFor example suppose $$$s\u003d$$$\u003cspan class\u003d\"tex-font-style-tt\"\u003eabcdef\u003c/span\u003e. If he performs the first operation with $$$i\u003d3$$$ then he appends \u003cspan class\u003d\"tex-font-style-tt\"\u003ecb\u003c/span\u003e to the front of $$$s$$$ and the result will be \u003cspan class\u003d\"tex-font-style-tt\"\u003ecbabcdef\u003c/span\u003e. Performing the second operation on the resulted string with $$$i\u003d5$$$ will yield \u003cspan class\u003d\"tex-font-style-tt\"\u003ecbabcdefedc\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eYour task is to help Ringo make the entire string a palindrome by applying any of the two operations (in total) \u003cspan class\u003d\"tex-font-style-bf\"\u003eat most $$$30$$$ times\u003c/span\u003e. \u003cspan class\u003d\"tex-font-style-bf\"\u003eThe length of the resulting palindrome must not exceed $$$10^6$$$\u003c/span\u003e\u003c/p\u003e\u003cp\u003eIt 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.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe only line contains the string $$$S$$$ ($$$3 \\le |s| \\le 10^5$$$) of lowercase letters from the English alphabet.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThe first line should contain $$$k$$$ ($$$0\\le k \\le 30$$$) \u0026nbsp;— the number of operations performed.\u003c/p\u003e\u003cp\u003eEach of the following $$$k$$$ lines should describe an operation in form \u003cspan class\u003d\"tex-font-style-tt\"\u003eL i\u003c/span\u003e or \u003cspan class\u003d\"tex-font-style-tt\"\u003eR i\u003c/span\u003e. $$$L$$$ represents the first operation, $$$R$$$ represents the second operation, $$$i$$$ represents the index chosen.\u003c/p\u003e\u003cp\u003eThe length of the resulting palindrome must not exceed $$$10^6$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabac\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\nR 2\nR 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eacccc\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\nL 4\nL 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003ehannah\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eFor the first example the following operations are performed:\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-tt\"\u003eabac\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eabacab\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eabacaba\u003c/span\u003e\u003c/p\u003e\u003cp\u003eThe second sample performs the following operations: \u003cspan class\u003d\"tex-font-style-tt\"\u003eacccc\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003ecccacccc\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eccccacccc\u003c/span\u003e\u003c/p\u003e\u003cp\u003eThe third example is already a palindrome so no operations are required.\u003c/p\u003e"}}]}