A subsequence is a sequence obtained by deleting zero or more characters from a string. A palindrome is a string that reads the same from left to right and from right to left. Given a string, find the longest palindromic subsequence. If there are several possible answers, choose the lexicographically smallest one.
The input consists of several tests, each given on a separate line. The maximum length of a line is . Each line contains only characters from 'a' to 'z'.
For each line, output the lexicographically smallest longest palindromic subsequence on a separate line.
Example 1