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.OutputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.BufferedWriter;
import java.util.Random;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        EArheologiya solver = new EArheologiya();
        solver.solve(1, in, out);
        out.close();
    }

    static class EArheologiya {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            if (false) {
                new Tester().test();
                return;
            }
            char[] s = in.next().toCharArray();
            char[] res = new Solver(s).solve100();
            if (res == null) {
                res = "IMPOSSIBLE".toCharArray();
            }
            out.print(res);
        }

        class Tester {
            Random rnd = new Random(239);

            char[] randomString(int n) {
                char[] s = new char[n];
                s[0] = (char) (rnd.nextInt(3) + 'a');
                for (int i = 1; i < n; i++) {
                    s[i] = (char) ((s[i - 1] - 'a' + rnd.nextInt(2) + 1) % 3 + 'a');
                }
                return s;
            }

            void test() {
                for (int t = 0; ; t++) {
                    int n = rnd.nextInt(6) + 2;
                    char[] s = randomString(n);
                    try {
                        char[] res = new Solver(s).solve100();
                        if (n == 3 && s[0] != s[1] && s[1] != s[2] && s[0] != s[2] && res == null) {
                            continue;
                        }
                        if (res.length * 2 < s.length) {
                            System.err.println("NO");
                            System.err.println(new String(s));
                            System.err.println(new String(res));
                        }
                    } catch (Exception e) {
                        char[] res = new Solver(s).solve100();
                        if (n == 3 && s[0] != s[1] && s[1] != s[2] && s[0] != s[2] && res == null) {
                            continue;
                        }
                        if (res.length * 2 < s.length) {
                            System.err.println("NO");
                            System.err.println(new String(s));
                            System.err.println(new String(res));
                        }
                    }
                }
            }

        }

        class Solver {
            char[] s;

            Solver(char[] s) {
                this.s = s;
            }

            char[] solve100() {
                int n = s.length;
                int l = 0;
                int r = n - 1;
                boolean[] take = new boolean[n];
                outer:
                while (r - l > 10) {
                    for (int rm = 0; rm <= 2; rm++) {
                        for (int x = l; x <= l + 1; x++) {
                            for (int y = r; y >= r - 1; y--) {
                                if (x > y) {
                                    continue;
                                }
                                if (s[x] == s[y]) {
                                    take[x] = take[y] = true;
                                    l = x + 1;
                                    r = y - 1;
                                    continue outer;
                                }
                            }
                        }
                    }
                    l++;
                }
                boolean[] naive = naive(l, r);
                for (int i = 0; i < naive.length; i++) {
                    take[l + i] = naive[i];
                }
                int ansLen = ArrayUtils.count(take, true);
                if (ansLen < n / 2) {
                    return null;
                }
                char[] ans = new char[ansLen];
                for (int i = 0, j = 0; i < n; i++) {
                    if (take[i]) {
                        ans[j++] = s[i];
                    }
                }
                return ans;
            }

            boolean[] naive(int l, int r) {
                int n = r - l + 1;
                boolean[] ans = new boolean[n];
                for (int m = 1; m < 1 << n; m++) {
                    boolean[] cur = new boolean[n];
                    for (int i = 0; i < n; i++) {
                        cur[i] = (((m >> i) & 1) == 1);
                    }
                    if (check(l, r, cur) && ArrayUtils.count(ans, true) < ArrayUtils.count(cur, true)) {
                        ans = cur;
                    }
                }
                return ans;
            }

            boolean check(int l, int r, boolean[] a) {
                int n = a.length;
                String str = "";
                for (int i = 0; i < n; i++) {
                    if (a[i]) {
                        str += s[l + i];
                    }
                }
                for (int i = 0; i < str.length() - i - 1; i++) {
                    if (str.charAt(i) != str.charAt(str.length() - i - 1)) {
                        return false;
                    }
                }
                return true;
            }

        }

    }

    static class ArrayUtils {
        public static int count(boolean[] array, boolean value) {
            int result = 0;
            for (boolean i : array) {
                if (i == value) {
                    result++;
                }
            }
            return result;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(char[] array) {
            writer.print(array);
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}