Program to transform a string to palindrome