Help Naruto!

0

0 votes
String manipulation
Problem

                                                       In Naruto, what was Kakashi's bell test? - Quora
Kakashi gave Naruto a string. The string consists of only lowercase characters. He wants Naruto to convert this string into a palindrome.

But Kakashi has some conditions:

     He should be able to convert the inital string into final string in least number of operations.
     If there are multiple strings print the lexographically minimum one.

The operation is : Choose any character from the string and convert it into any other lowercase character.

Naruto is tied up by a rope to a tree trunk and doesnt have a piece of paper to solve this problem. Help naruto to convert the intial string to the required string asked by Kakashi.

Note : After converting few characters/doing the operation you can rearrange them into any order you want. Rearranging the characters does not count as operation.

Input Format:
The only input consists of a string s

Constraints:
1 ≤ |length of string| ≤ 2·10^5 

Output Format
Print the final string asked by Kakashi.

   

Sample Input
aaabbbhhlhlugkjgckj
Sample Output
aabbghjklclkjhgbbaa
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?