Yet Another Palindrome Problem

CodeForces - 1324B