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.*;
import java.math.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.util.Comparator.*;

public class Main {
    FastScanner in;
    PrintWriter out;
    boolean multitests = false;
    long mod = 998_244_353L; // (long) 1e9 + 7 || (long) 1e9 + 9
    ArrayList<Integer>[] graph;
    ArrayList<Integer>[] weigtedGraph;

    private void solve() throws IOException {
        // solveA();
        // solveB();
        // solveC();
        // solveD();
        solveE();
        // solveF();
        // solveG();
        // solveH();
    }

    private void solveA() throws IOException {
        int n = in.nextInt();
        long[] a = in.nextLongArray(n);
        long sum = sum(a), col = a[0];
        boolean[] inCol = new boolean[n];
        inCol[0] = true;
        int cnt = 1;
        for (int i = 1; i < n; i++)
            if (a[0] >= 2 * a[i]) {
                col += a[i];
                inCol[i] = true;
                cnt++;
            }
        if (col * 2 > sum) {
            out.println(cnt);
            for (int i = 0; i < n; i++) {
                if (inCol[i])
                    out.print(i + 1 + " ");
            }
        } else
            out.println(0);
    }

    private void solveB() throws IOException {
        char[] s = ('-' + in.next()).toCharArray();
        int n = s.length;
        long[][] dp = new long[3][n];
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < 3; j++)
                dp[j][i] = dp[j][i - 1];
            if (s[i] == 'o')
                dp[1][i] += dp[0][i - 1];
            if (s[i] == 'v' && s[i - 1] == 'v') {
                dp[2][i] += dp[1][i - 2];
                dp[0][i]++;
            }
        }
        out.println(dp[2][n - 1]);
    }

    private void solveC() throws IOException {
        out.println(binpowmod(2, in.nextInt() + in.nextInt()));
    }

    private void solveD() throws IOException {
        boolean[] isPrime = new boolean[2001];
        fill(isPrime, true);
        for (int i = 2; i * i <= 2000; i++)
            if (isPrime[i])
                for (int j = i * i; j <= 2000; j += i)
                    isPrime[j] = false;

        int n = in.nextInt();
        graph = new ArrayList[n];
        for (int i = 0; i < n; i++)
            graph[i] = new ArrayList<>();

        int cnt = 0;
        for (int i = 0; i < n; i++) {
            graph[i].add((i + 1) % n);
            graph[(i + 1) % n].add(i);
            cnt++;
        }

        for (int i = 0, j; !isPrime[cnt]; i++) {
            if (graph[i].size() == 2) {
                for (j = i + 2; ; j++) {
                    if (graph[j].size() == 2) {
                        graph[i].add(j);
                        graph[j].add(i);
                        cnt++;
                        break;
                    }
                }
            }
        }

        out.println(cnt);
        for (int i = 0; i < n; i++)
            for (int j : graph[i])
                if (j > i)
                    out.println(i + 1 + " " + (j + 1));
    }

    private void solveE() throws IOException {
        char[] s = in.next().toCharArray();
        int n = s.length, len = n / 2;
        int l = 0, r = n - 1, cntr = 0;
        boolean[] used = new boolean[n];
        while (l <= r) {
            if (s[l] == s[r]) {
                cntr += l == r ? 1 : 2;
                used[l++] = true;
                used[r--] = true;
            } else if (l + 1 == r) {
                cntr++;
                used[l++] = true;
                r--;
            } else if (l + 1 == r - 1) {
                if (s[l] == s[l + 1]) {
                    used[l++] = true;
                    used[l++] = true;
                    r--;
                    cntr += 2;
                } else if (s[r] == s[r - 1]) {
                    used[r--] = true;
                    used[r--] = true;
                    l++;
                    cntr += 2;
                } else {
                    cntr++;
                    used[l++] = true;
                    l++;
                    r--;
                }
            } else { // > 3
                if (s[l + 1] == s[r]) {
                    cntr += 2;
                    l++;
                    used[l++] = true;
                    used[r--] = true;
                } else if (s[l] == s[r - 1]) {
                    cntr += 2;
                    used[l++] = true;
                    r--;
                    used[r--] = true;
                } else if (s[l + 1] == s[r - 1]) {
                    cntr += 2;
                    l++;
                    used[l++] = true;
                    r--;
                    used[r--] = true;
                } else
                    n = 1 / 0;
            }
        }

        if (cntr < len)
            n = 1 / 0;

        for (int i = 0; i < n; i++)
            if (used[i])
                out.print(s[i]);
    }

    private void solveF() throws IOException {

    }

    private void solveG() throws IOException {

    }

    private void solveH() throws IOException {

    }

    void shuffleInt(int[] a) {
        Random random = new Random();
        for (int i = a.length - 1; i > 0; i--) {
            int j = random.nextInt(i + 1);
            int swap = a[j];
            a[j] = a[i];
            a[i] = swap;
        }
    }

    void shuffleLong(long[] a) {
        Random random = new Random();
        for (int i = a.length - 1; i > 0; i--) {
            int j = random.nextInt(i + 1);
            long swap = a[j];
            a[j] = a[i];
            a[i] = swap;
        }
    }

    void reverseInt(int[] a) {
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            int swap = a[i];
            a[i] = a[j];
            a[j] = swap;
        }
    }

    void reverseLong(long[] a) {
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            long swap = a[i];
            a[i] = a[j];
            a[j] = swap;
        }
    }

    int maxInt(int[] a) {
        int max = a[0];
        for (int i = 1; i < a.length; i++)
            if (max < a[i])
                max = a[i];
        return max;
    }

    long maxLong(long[] a) {
        long max = a[0];
        for (int i = 1; i < a.length; i++)
            if (max < a[i])
                max = a[i];
        return max;
    }

    int minInt(int[] a) {
        int min = a[0];
        for (int i = 1; i < a.length; i++)
            if (min > a[i])
                min = a[i];
        return min;
    }

    long minLong(long[] a) {
        long min = a[0];
        for (int i = 1; i < a.length; i++)
            if (min > a[i])
                min = a[i];
        return min;
    }

    long sum(int[] a) {
        long s = 0;
        for (int i = 0; i < a.length; i++)
            s += a[i];
        return s;
    }

    long sum(long[] a) {
        long s = 0;
        for (int i = 0; i < a.length; i++)
            s += a[i];
        return s;
    }

    long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    long binpowmod(long a, long n) {
        long res = 1;
        a %= mod;
        n %= mod - 1;
        while (n > 0) {
            if (n % 2 == 1)
                res = (res * a) % mod;
            a = (a * a) % mod;
            n /= 2;
        }
        return res;
    }

    class GraphPair implements Comparable<GraphPair> {
        int v;
        long w;

        GraphPair(int v, long w) {
            this.v = v;
            this.w = w;
        }

        public int compareTo(GraphPair o) {
            return w != o.w ? Long.compare(w, o.w) : Integer.compare(v, o.v);
        }
    }

    class FastScanner {
        StringTokenizer st;
        BufferedReader br;

        FastScanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        boolean hasNext() throws IOException {
            return br.ready() || (st != null && st.hasMoreTokens());
        }

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

        int[] nextIntArray(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextInt();
            return a;
        }

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

        long[] nextLongArray(int n) throws IOException {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = in.nextLong();
            return a;
        }

        ArrayList<Integer>[] nextGraph(int n, int m, boolean directed) throws IOException {
            ArrayList<Integer>[] graph = new ArrayList[n];
            for (int i = 0; i < n; i++)
                graph[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int v = in.nextInt() - 1, u = in.nextInt() - 1;
                graph[v].add(u);
                if (!directed)
                    graph[u].add(v);
            }
            return graph;
        }

        ArrayList<GraphPair>[] nextWeightedGraph(int n, int m, boolean directed) throws IOException {
            ArrayList<GraphPair>[] graph = new ArrayList[n];
            for (int i = 0; i < n; i++)
                graph[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int v = in.nextInt() - 1, u = in.nextInt() - 1;
                long w = in.nextLong();
                graph[v].add(new GraphPair(u, w));
                if (!directed)
                    graph[u].add(new GraphPair(v, w));
            }
            return graph;
        }

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

        String nextLine() throws IOException {
            return br.readLine();
        }

        boolean hasNextLine() throws IOException {
            return br.ready();
        }
    }

    private void run() throws IOException {
        in = new FastScanner(System.in); // new FastScanner(new FileInputStream(".in"));
        out = new PrintWriter(System.out); // new PrintWriter(new FileOutputStream(".out"));

        for (int t = multitests ? in.nextInt() : 1; t-- > 0; )
            solve();

        out.flush();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}