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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author null
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Input in = new Input(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, Input in, PrintWriter out) {
            try {
                char[] s = in.readWord().toCharArray();
                int n = s.length;
                StringBuilder buf = new StringBuilder();
                int p1 = 0;
                int p2 = n - 1;
                while (p1 + 3 < p2 - 3) {
                    boolean found = false;
                    for (int x1 = 0; x1 < 3 && !found; x1++) {
                        for (int y1 = 0; y1 < 3 && !found; y1++) {
                            if (s[p1 + x1] == s[p2 - y1]) {
                                for (int x2 = x1 + 1; x2 < 4 && !found; x2++) {
                                    for (int y2 = y1 + 1; y2 < 4 && !found; y2++) {
                                        if (s[p1 + x2] == s[p2 - y2]) {
                                            found = true;
                                            buf.append(s[p1 + x1]).append(s[p1 + x2]);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    p1 += 4;
                    p2 -= 4;
                }
                out.print(buf.toString());

                String max = "";
                int[] b = new int[7];
                for (b[0] = 0; b[0] <= 1; b[0]++) {
                    for (b[1] = 0; b[1] <= 1; b[1]++) {
                        for (b[2] = 0; b[2] <= 1; b[2]++) {
                            for (b[3] = 0; b[3] <= 1; b[3]++) {
                                for (b[4] = 0; b[4] <= 1; b[4]++) {
                                    for (b[5] = 0; b[5] <= 1; b[5]++) {
                                        for (b[6] = 0; b[6] <= 1; b[6]++) {
                                            StringBuilder str = new StringBuilder();
                                            for (int i = p1; i <= p2; i++) {
                                                if (b[i - p1] == 1) {
                                                    str.append(s[i]);
                                                }
                                            }
                                            String l = str.toString();
                                            String r = str.reverse().toString();
                                            if (l.equals(r) && l.length() > max.length()) {
                                                max = l;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                out.print(max);

                out.print(buf.reverse().toString());

                out.println();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

    }

    static class Input {
        public final BufferedReader reader;
        private String line = "";
        private int pos = 0;

        public Input(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private boolean isSpace(char ch) {
            return ch <= 32;
        }

        public String readWord() throws IOException {
            skip();
            int start = pos;
            while (pos < line.length() && !isSpace(line.charAt(pos))) {
                pos++;
            }
            return line.substring(start, pos);
        }

        private void skip() throws IOException {
            while (true) {
                if (pos >= line.length()) {
                    line = reader.readLine();
                    pos = 0;
                }
                while (pos < line.length() && isSpace(line.charAt(pos))) {
                    pos++;
                }
                if (pos < line.length()) {
                    return;
                }
            }
        }

    }
}