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.*;
public class Scanner_ {
    //global methods
    static class MyReader {
        BufferedReader br;
        StringTokenizer st;

        public MyReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String ne() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(ne());
        }

        long nl() {
            return Long.parseLong(ne());
        }

        double nd() {
            return Double.parseDouble(ne());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args) throws IOException {
        new Thread(null, null, "rahsut", 1 << 25) {
            public void run() {
                try {
                    solve();
                } catch (Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static long modPow(long x,long p,long m) {
        if(p==0)
            return 1;
        if(p%2==0)
            return modPow((x*x)%m,p>>1,m)%m;
        return x*(modPow(x,p-1,m)%m)%m;
    }
    //global variables
    static MyReader sc = new MyReader();
    static StringBuilder sb = new StringBuilder();
    static PrintWriter pw = new PrintWriter(System.out, true);

    static void solve() throws IOException {
        char arr[]= sc.ne().toCharArray();
        LinkedList<Integer> a = new LinkedList<>();
        LinkedList<Integer> b = new LinkedList<>();
        LinkedList<Integer> c = new LinkedList<>();
        for(int i =0;i<arr.length;i++) {
            if(arr[i]=='a')
                a.add(i);
            else if(arr[i]=='b')
                b.add(i);
            else
                c.add(i);
        }
        StringBuilder first = new StringBuilder();
        int i = 0,j = arr.length-1,len=0,add=0;
        if(j<3) {
            System.out.println(arr[i]);
            System.exit(0);
        }

        while(i<=j) {
            int max =0,at=-1,l,r;

            if(a.size()>1 && max< a.peekLast() - a.peekFirst() -1) {
                max = a.peekLast() - a.peekFirst() -1;
                at =1;
            }
            if(b.size()>1 && max< b.peekLast() - b.peekFirst() -1) {
                max = b.peekLast() - b.peekFirst() -1;
                at =2;
            }
            if(c.size()>1 && max< c.peekLast() - c.peekFirst() -1) {
                max = c.peekLast() - c.peekFirst() -1;
                at =3;
            }
            if(at==1) {
                first.append('a');
                l=a.pollFirst();
                r = a.pollLast();
                remove(b,l,r);
                remove(c,l,r);
            }
            else if(at==2) {
                first.append('b');
                l=b.pollFirst();
                r = b.pollLast();
                remove(a,l,r);
                remove(c,l,r);
            }
            else if(at == 3){
                first.append('c');
                l = c.pollFirst();
                r = c.pollLast();
                remove(b,l,r);
                remove(a,l,r);
            }else {
                if(j-i>1) {
                    i++;
                    j = i;
                    add++;
                }
                break;
            }
            len+=2;
            i=l;j =r;
        }
        if(len+add>=arr.length/2) {
            System.out.print(first);
            if(i==j)
                System.out.print(arr[i]);
            first.reverse();
            System.out.println(first);
        }else
            System.out.println("IMPOSSIBLE");
    }
    static void remove(LinkedList<Integer> list ,int l,int r) {
        while(!list.isEmpty() && list.peekFirst()<l)
            list.pollFirst();
        while(!list.isEmpty() && list.peekLast()>r)
            list.pollLast();
    }
}