{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAlice bought a Congo Prime Video subscription and was watching a documentary on the archaeological findings from Factor\u0027s Island on Loch Katrine in Scotland. The archaeologists found a book whose age and origin are unknown. Perhaps Alice can make some sense of it?\u003c/p\u003e\u003cp\u003eThe book contains a single string of characters \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\". It has been pointed out that no two consecutive characters are the same. It has also been conjectured that the string contains an unusually long subsequence that reads the same from both sides. \u003c/p\u003e\u003cp\u003eHelp Alice verify this by finding such subsequence that contains at least half of the characters of the original string, rounded down. Note that you don\u0027t have to maximise the length of it.\u003c/p\u003e\u003cp\u003eA string $$$a$$$ is a subsequence of a string $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by deletion of several (possibly, zero or all) characters.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input consists of a single string $$$s$$$\u0026nbsp;($$$2 \\leq |s| \\leq 10^6$$$). The string $$$s$$$ consists only of characters \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\". It is guaranteed that no two consecutive characters are equal.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput a palindrome $$$t$$$ that is a subsequence of $$$s$$$ and $$$|t| \\geq \\lfloor \\frac{|s|}{2} \\rfloor$$$.\u003c/p\u003e\u003cp\u003eIf there are multiple solutions, you may print any of them. You don\u0027t have to maximise the length of $$$t$$$.\u003c/p\u003e\u003cp\u003eIf there are no solutions, output a string \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eIMPOSSIBLE\u003c/span\u003e\" (quotes for clarity).\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\u003ecacbac\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eaba\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\u003eabc\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003ea\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\u003ecbacacacbcbababacbcb\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003ecbaaacbcaaabc\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\u003eIn the first example, other valid answers include \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecacac\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecaac\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaca\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eccc\u003c/span\u003e\". \u003c/p\u003e"}}]}