(The original statement in Catalan has some jokes. This English version goes straight to the point of the problem.)
A palindrome has been broken into pieces. Put the pieces together in the right order.
Input consists of several cases. Every case begins with the number of pieces . Follow the pieces, made up of only lowercase letters. Assume .
For every case, print the palindrome that can be made by joining all the pieces. There is always exactly one solution.
Author: Alex Alvarez
Generation: 2026-01-25T11:17:41.230Z
© Jutge.org, 2006–2026.
https://jutge.org