Problem: Alice bought a Congo Prime Video subscription and was watching a documentary on the archaeological findings from Factor's Island on Loch Katrine in Scotland. The archaeologists found a book whose age and origin are unknown. Perhaps Alice can make some sense of it?

The book contains a single string of characters "a", "b" and "c". It has been pointed out that no two consecutive characters are the same. It has also been conjectured that the string contains an unusually long subsequence that reads the same from both sides. 

Help Alice verify this by finding such subsequence that contains at least half of the characters of the original string, rounded down. Note that you don't have to maximise the length of it.

A string a is a subsequence of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters.

Input

The input consists of a single string s (2 ≤ |s| ≤ 10^6). The string s consists only of characters "a", "b", "c". It is guaranteed that no two consecutive characters are equal.

Output

Output a palindrome t that is a subsequence of s and |t| ≥ ⌊ (|s|)/(2) ⌋.

If there are multiple solutions, you may print any of them. You don't have to maximise the length of t.

If there are no solutions, output a string "IMPOSSIBLE" (quotes for clarity).

Examples

Input


cacbac


Output


aba


Input


abc


Output


a


Input


cbacacacbcbababacbcb


Output


cbaaacbcaaabc

Note

In the first example, other valid answers include "cacac", "caac", "aca" and "ccc". 

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.math.BigInteger;
public class Main
{
    static MyScanner scan;
    static PrintWriter pw;
    static long MOD = 998244353 ;
    static long INF = 1_000_000_000_000_000_000L;
    static long inf = 2_000_000_000;
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",1<<25)
        {
            public void run()
            {
                try
                {
                    solve();
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }

    static void solve() throws IOException
    {
        //initIo(true);
        initIo(false);
        StringBuilder sb = new StringBuilder();
        String s = ne();
        int n = s.length();
        LinkedList<Integer> a = new LinkedList<>();
        LinkedList<Integer> b = new LinkedList<>();
        LinkedList<Integer> c = new LinkedList<>();
        for(int i=0;i<n;++i) {
            if(s.charAt(i)=='a') {
                a.addLast(i);
            }
            else if(s.charAt(i)=='b') {
                b.addLast(i);
            }
            else {
                c.addLast(i);
            }
        }
        LinkedList<Integer> first_part = new LinkedList<>();
        LinkedList<Integer> second_part = new LinkedList<>();
        int currL = 0, currR = n-1;
        while(currL<=currR) {
            int max = 0, at = -1;
            if(a.size()>1) {
                if(max < a.getLast() - a.getFirst() - 1) {
                    max =  a.getLast() - a.getFirst() - 1;
                    at = 0;
                }
            }
            if(b.size()>1) {
                if(max < b.getLast() - b.getFirst() - 1) {
                    max =  b.getLast() - b.getFirst() - 1;
                    at = 1;
                }
            }
            if(c.size()>1) {
                if(max < c.getLast() - c.getFirst() - 1) {
                    max =  c.getLast() - c.getFirst() - 1;
                    at = 2;
                }
            }
            //pl("currL: "+currL+" currR: "+currR+" max: "+max+" at: "+at);
            if(at==-1) {
                break;
            }
            else {
                if(at==0) {
                    int pehla = a.pollFirst(), last = a.pollLast();
                    currL = pehla+1;
                    currR = last-1;
                    first_part.addLast(pehla);
                    second_part.addFirst(last);
                }
                else if(at==1) {
                    int pehla = b.pollFirst(), last = b.pollLast();
                    currL = pehla+1;
                    currR = last-1;
                    first_part.addLast(pehla);
                    second_part.addFirst(last);
                }
                else {
                    int pehla = c.pollFirst(), last = c.pollLast();
                    currL = pehla+1;
                    currR = last-1;
                    first_part.addLast(pehla);
                    second_part.addFirst(last);
                }
                removeExtra(a, currL, currR);
                removeExtra(b, currL, currR);
                removeExtra(c, currL, currR);
            }
        }
        if(!a.isEmpty()) {
            first_part.addLast(a.pollFirst());
        }
        else if(!b.isEmpty()) {
            first_part.addLast(b.pollFirst());
        }
        else if(!c.isEmpty()) {
            first_part.addLast(c.pollFirst());
        }
        int sz = first_part.size() + second_part.size();
        if(sz>=n/2) {
            for(int e : first_part) {
                pw.print(s.charAt(e));
            }
            for(int e : second_part) {
                pw.print(s.charAt(e));
            }
            pl();
        }
        else {
            pl("IMPOSSIBLE");
        }
        pw.flush();
        pw.close();
    }
    static void removeExtra(LinkedList<Integer> list, int l, int r) {
        while(!list.isEmpty() && list.getFirst()<l) {
            list.pollFirst();
        }
        while(!list.isEmpty() && list.getLast()>r) {
            list.pollLast();
        }
    }
    static void initIo(boolean isFileIO) throws IOException {
        scan = new MyScanner(isFileIO);
        if(isFileIO) {
            pw = new PrintWriter("/Users/amandeep/Desktop/output.txt");
        }
        else {
            pw = new PrintWriter(System.out, true);
        }
    }
    static int ni() throws IOException
    {
        return scan.nextInt();
    }
    static long nl() throws IOException
    {
        return scan.nextLong();
    }
    static double nd() throws IOException
    {
        return scan.nextDouble();
    }
    static String ne() throws IOException
    {
        return scan.next();
    }
    static String nel() throws IOException
    {
        return scan.nextLine();
    }
    static void pl()
    {
        pw.println();
    }
    static void p(Object o)
    {
        pw.print(o+" ");
    }
    static void pl(Object o)
    {
        pw.println(o);
    }
    static void psb(StringBuilder sb)
    {
        pw.print(sb);
    }
    static void pa(String arrayName, Object arr[])
    {
        pl(arrayName+" : ");
        for(Object o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, int arr[])
    {
        pl(arrayName+" : ");
        for(int o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, long arr[])
    {
        pl(arrayName+" : ");
        for(long o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, double arr[])
    {
        pl(arrayName+" : ");
        for(double o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, char arr[])
    {
        pl(arrayName+" : ");
        for(char o : arr)
            p(o);
        pl();
    }
    static void pa(String listName, List list)
    {
        pl(listName+" : ");
        for(Object o : list)
            p(o);
        pl();
    }
    static void pa(String arrayName, Object[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(Object o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, int[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(int o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, long[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(long o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, char[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(char o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, double[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(double o : arr[i])
                p(o);
            pl();
        }
    }
    static class MyScanner
    {
        BufferedReader br;
        StringTokenizer st;
        MyScanner(boolean readingFromFile) throws IOException
        {
            if(readingFromFile) {
                br = new BufferedReader(new FileReader("/Users/amandeep/Desktop/input.txt"));
            }
            else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
        }
        String nextLine()throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}