1. Glass Reflection

FPC 2024 First Teaser Puzzle

Late in the evening, you are sitting at the Funky Punk Café and feeling a bit bored because you have not done any programming all day. You stare out of the window and see that the text on the neon signs gets reflected in a funny way: the letters are partially overlapping, because the window is made of double-paned glass. Would it be possible to automatically read the text of the sign, just by looking at this mangled reflection? With a burst of sudden inspiration, you grab your laptop and OCR camera from your bag, and start programming.

Your OCR camera appears to correctly recognize the letters in the reflection when it accounts for the mirroring, except that all the letters are duplicated. Moreover, if the text on the sign contains double (or more) letters, their reflection partially overlaps, resulting in only one more letter than there would be in the original word. For example, the word “beer” is reflected as “bbeeerr”, and the word “ooo” is reflected as “oooo”. All that is left for you to do, is to write a program that converts these reflected words back to their original form.

Samples

Sample Input Sample Output
bbeeerr beer
sskkiilllleesssnneesss skilllessness
bbaalllooonnnoookkkeeeppeerr balloonnookkeeper

Final Test

Input Next Puzzle
yyoouuuuuaarreennoowwoonnneesstteeppccllooosseerriinntthhiisssseerriieesssooffpprroommoottiioonnaallppuuzzzzlleessffoorrtthheeffrreesshhmmeeennpprrooggrrraaammmmiinnggccoonntteessstt https://chipcie.wisv.ch/fpc/<OUTPUT>