This problem's actual name, "Lexicographically Largest Palindromic Subsequence" is too long to fit into the page headline.

You are given string s consisting of lowercase English letters only. Find its lexicographically largest palindromic subsequence.

We'll call a non-empty string s[p1p2... pk] = sp1sp2... spk (1 ≤  p1 < p2 < ... < pk ≤  |s|) a subsequence of string s = s1s2... s|s|, where |s| is the length of string s. For example, strings "abcb", "b" and "abacaba" are subsequences of string "abacaba".

String x = x1x2... x|x| is lexicographically larger than string y = y1y2... y|y| if either |x| > |y| and x1 = y1, x2 = y2, ..., x|y| = y|y|, or there exists such number r (r < |x|, r < |y|) that x1 = y1, x2 = y2, ..., xr = yr and xr + 1 > yr + 1. Characters in the strings are compared according to their ASCII codes. For example, string "ranger" is lexicographically larger than string "racecar" and string "poster" is lexicographically larger than string "post".

String s = s1s2... s|s| is a palindrome if it matches string rev(s) = s|s|s|s| - 1... s1. In other words, a string is a palindrome if it reads the same way from left to right and from right to left. For example, palindromic strings are "racecar", "refer" and "z".

Input

The only input line contains a non-empty string s consisting of lowercase English letters only. Its length does not exceed 10.

Output

Print the lexicographically largest palindromic subsequence of string s.

Examples

Input

radar


Output

rr


Input

bowwowwow


Output

wwwww


Input

codeforces


Output

s


Input

mississipp


Output

ssss

Note

Among all distinct subsequences of string "radar" the following ones are palindromes: "a", "d", "r", "aa", "rr", "ada", "rar", "rdr", "raar" and "radar". The lexicographically largest of them is "rr".
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int largestAscii = Integer.MIN_VALUE;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i) > largestAscii){
                largestAscii = str.charAt(i);
            }
        }
        String value = "";
        for(int i=0;i<str.length();i++){
            if(str.charAt(i) == largestAscii){
                value += Character.toString((char)largestAscii);
            }
        }
        System.out.println(value);
    }
}

//////import java.util.Arrays;
//////
////////public class Main{
//////public class Main {
//////
//////    private static double getMaxValue(int wt[], int val[], int capacity){
//////        ItemValue iVal [] = new ItemValue[wt.length];
//////
//////        for(int i=0;i<wt.length;i++){
//////            iVal[i] = new ItemValue(wt[i],val[i],i);
//////        }
//////
//////        Arrays.sort(iVal,(o1, o2) -> Double.compare(o2.cost, o1.cost));
//////
//////        double totalValue = 0;
//////        for(ItemValue i : iVal){
//////            int curWt = (int)i.wt;
//////            int curVal = (int)i.val;
//////
//////            if(capacity - curWt > 0){{
//////                capacity -= curWt;
//////                totalValue += curVal;
//////            }else{
//////                double fraction = ((double) capacity / (double) curWt);
//////                totalValue += fraction * curVal;
//////                capacity = (int) (capacity - (curWt * fraction));
//////                break;
//////            }
//////        }
//////        return totalValue;
//////    }
//////
//////    static class ItemValue {
//////        double cost;
//////        double wt,val,ind;
//////
//////        public ItemValue(double wt, double val, int ind) {
//////            this.cost =  val / wt;
//////            this.wt = wt;
//////            this.val = val;
//////            this.ind = ind;
//////        }
//////    }
//////
//////    public static void main(String[] args) {
//////        int wt[] = {10,40,20,30};
//////        int val[] = {60,40,100,120};
//////        int capacity = 50;
//////
//////        double maxValue = getMaxValue(wt,val,capacity);
//////
//////        System.out.println("Max value is " + maxValue);
//////    }
//////}
////
//////import java.util.Arrays;
//////
//////public class Main{
//////
//////    public static int calcMaxProfits(char jobIds[], int deadlines[], int profits[]){
//////         Job jobArr[] = new Job[jobIds.length];
//////
//////         for(int i=0;i<jobIds.length;i++){
//////             jobArr[i] = new Job(jobIds[i],deadlines[i],profits[i]);
//////         }
//////        Arrays.sort(jobArr,(obj1,obj2)->obj2.profits - obj1.profits);
//////        int arrPos[] = new int[jobIds.length];
//////        int j = 0;
//////        for(int i=0;i<jobIds.length;i++){
//////            j = jobArr[i].deadline - 1;
//////            while(j>=0){
//////                if(arrPos[j] == 0){
//////                    arrPos[j] = jobArr[i].profits;
//////                    break;
//////                }else{
//////                    j--;
//////                }
//////            }
//////        }
//////        int maxProfits = 0;
//////        for(int prof: arrPos){
//////            maxProfits += prof;
//////        }
//////         return maxProfits;
//////    }
//////
//////    static class Job{
//////        char jobId;
//////        int deadline;
//////        int profits;
//////
//////        public Job(char jobId, int deadline, int profits) {
//////            this.jobId = jobId;
//////            this.deadline = deadline;
//////            this.profits = profits;
//////        }
//////    }
//////
//////    public static void main(String[] args) {
//////        char jobIds [] = {'a','b','c','d'};
//////        int deadlines[] = {4,1,1,1};
//////        int profits [] = {20,10,40,30};
//////
//////        int maxProfits = calcMaxProfits(jobIds,deadlines,profits);
//////        System.out.println("Max profits are " + maxProfits);
//////    }
//////}
//
//import java.util.HashMap;
//import java.util.Scanner;
//
//public class Main{
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int noOfStudents = scanner.nextInt();
//        int students[] = new int[noOfStudents];
//
//        HashMap<Number,Number> h = createArr(students,noOfStudents,scanner);
//
//        int i =0;
//        String str = "";
//        int student = 1;
//        while((int) h.get(1) != 0 &&(int) h.get(2) !=0 && (int) h.get(3) != 0){
//            if(students[i] == student){
//                if(student == 3){
//                    student = 0 ;
//                }else{
//                    student++;
//                }
//                str += i;
//                h.put(student,(int) h.get(student)-1);
//                students[i] = 0;
//            }else{
//                i++;
//            }
//            if(i == students.length){
//                i = 0;
//            }
//        }
//    }
//
//    public static HashMap<Number, Number> createArr(int arr[], int length, Scanner scanner){
//        HashMap<Number,Number> h = new HashMap<Number,Number>();
//        int one = 0;
//        int two = 0;
//        int three = 0;
//        for(int i=0;i<length;i++){
//            int el = scanner.nextInt();
//            arr[i] = el;
//            if(el == 1){
//                one++;
//            }else if (el == 2){
//                two++;
//            }else{
//                three++;
//            }
//        }
//        h.put(1,one);
//        h.put(2,two);
//        h.put(3,three);
//        return h;
//    }
//}
//
////import java.util.Scanner;
////
////public class Main {
////    public static void main(String[] args) {
////
////    }
////
////    private static int create2dArr(Scanner scanner, int twdDArr[][],int rows,int cols, int k){
////        int count = 0;
////        int el;
////        for(int i=0;i<rows;i++){
////            for(int j=0;j<cols;j++){
////               el = scanner.nextInt();
////               if(el >= k)count++;
////               twdDArr[i][j] = el;
////            }
////        }
////        return count;
////    }
////
////    private static int squareMatrixAvg(int twoDArr[][],int rows,int cols,int max){
////        int k = 2;
////        int count = 0;
////        while(rows-k+1 != 1){
////
////            for(int i=0;i< rows-k+1;i++){
////                for(int j=0;j< cols - k + 1; j++){
////                    int sum =0;
////                    int length = 0;
////                    for(int p=i;p<k+i;p++){
////                        for(int q=j;q<k+j;q++){
////                            sum+=twoDArr[p][q];
////                            length++;
////                        }
////                    }
////                    if((double)sum/ length >= (double)max)count++;
////                }
////            }
////            k++;
////        }
////        return count;
////    }
////}
