Олимпиадный тренинг

Задача 29473. Palindrome


Задача

Темы:
A palindrome is a string that reads the same from right to left as it does from left to right. 
 
The input of the program is a set of large Latin letters (not necessarily different). It is allowed to rearrange the letters, as well as delete some letters. It is required from these letters to compose a palindrome of the greatest length according to the specified rules, and if there are several such palindromes, then choose the first of them in alphabetical order.
 
Input
The first line of the input contains the number N (1 <= N <= 100000). The second line contains a sequence of N large Latin letters (letters are written without spaces).
 
Output
In a single line of output, print the palindrome you're looking for.
 
Input Output
3
AAB
ABA
6
QAZQAZ
AQZZQA
6
ABCDEF
A

Запрещенные операторы:sort