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.*;
public class codeforces{
    // Input
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String s = null;
            try {
                s = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return s;
        }

        public String nextParagraph() {
            String line = null;
            String ans = "";
            try {
                while ((line = reader.readLine()) != null) {
                    ans += line;
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return ans;
        }
    }
    //Template
    static int mod = 998244353;
    static void printArray(int ar[]){ for(int x:ar) System.out.print(x+" ");}
    static void printArray(ArrayList<Integer> ar){ for(int x:ar) System.out.print(x+" ");}
    static int gcd(int a, int b){ if (a == 0) return b; return gcd(b%a, a);}
    static long power(long x, long y, int p) { long res = 1; x = x % p;  while (y > 0) { if((y & 1)==1) res = (res * x) % p; y = y >> 1;x = (x * x) % p;  } return res;}
    static void takeArrayInput(InputReader sc, int ar[]){ for(int i=0;i<ar.length;i++) ar[i]=sc.nextInt(); }
    static void takeArrayInput(InputReader sc, long ar[]){ for(int i=0;i<ar.length;i++) ar[i]=sc.nextLong(); }
    static void take2dArrayInput(InputReader sc, int ar[][]){ for(int i=0;i<ar.length;i++) for(int j=0;j<ar[i].length;j++) ar[i][j]=sc.nextInt(); }
    static void take2dArrayInput(InputReader sc, long ar[][]){ for(int i=0;i<ar.length;i++) for(int j=0;j<ar[i].length;j++) ar[i][j]=sc.nextLong(); }
    static ArrayList<ArrayList<Integer>> graph(InputReader sc, int n, int m){
        ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
        for(int i=0;i<n;i++) list.add(new ArrayList<Integer>());
        for(int i=0;i<m;i++){ int u = sc.nextInt(); int v = sc.nextInt(); list.get(u).add(v); list.get(v).add(u); }
        return list;
    }
    // Write Code Here
    static class Data {
        int u;
        int v;
        public Data(int e, int val) {
            this.u = e;
            this.v = val;
        }
    }
    static void sieveOfEratosthenes(int n, ArrayList<Integer> pr) {
        // Create a boolean array "prime[0..n]" and initialize
        // all entries it as true. A value in prime[i] will
        // finally be false if i is Not a prime, else true.
        boolean prime[] = new boolean[n + 1];
        for (int i = 0; i < n; i++)
            prime[i] = true;
        for (int p = 2; p * p <= n; p++) {
            // If prime[p] is not changed, then it is a prime
            if (prime[p] == true) {
                // Update all multiples of p
                pr.add(p);
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }
    }
    public static void main(String args[]) {
        InputReader sc = new InputReader();
        PrintWriter pw = new PrintWriter(System.out);
        String s = sc.nextLine();
        char c[] = s.toCharArray();
        int i=0, j=s.length()-1;
        StringBuilder p = new StringBuilder("");
        while((j - i) >= 3){
            if(c[i] == c[j]){
                p.append(c[i]);
                i++;j--;
            }else if(c[i] == c[j-1]){
                p.append(c[i]);
                i++;j -= 2;
            }else if(c[i+1] == c[j]){
                p.append(c[i+1]);
                i+=2;j--;
            }else{
                p.append(c[i+1]);
                i+=2;j-=2;
            }
        }
        StringBuilder sb = new StringBuilder(p.toString());
        sb.reverse();
        if(j >= i) p.append(c[j]);
        pw.print(p.append(sb.toString()).toString());
        pw.close();
    }
}