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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void pri(deque<int> arr) {
  for (int i : arr) cout << i << " ";
  cout << endl;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  if (n <= 3) {
    cout << s[0] << endl;
    return 0;
  }
  deque<int> a1;
  deque<int> b1;
  deque<int> c1;
  int as[n + 2];
  int bs[n + 2];
  int cs[n + 2];
  memset(as, 0, sizeof as);
  memset(bs, 0, sizeof bs);
  memset(cs, 0, sizeof cs);
  as[0] = 0;
  bs[0] = 0;
  cs[0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      a1.push_back(i);
      as[i + 1]++;
    } else if (s[i] == 'b') {
      b1.push_back(i);
      bs[i + 1]++;
    } else {
      c1.push_back(i);
      cs[i + 1]++;
    }
    as[i + 1] += as[i];
    bs[i + 1] += bs[i];
    cs[i + 1] += cs[i];
  }
  int lim = -10;
  int mx = 1000006;
  string ans = "";
  while (true) {
    int a = lim;
    int b = lim;
    int c = lim;
    if (a1.size() > 1) {
      a = a1[a1.size() - 1] - a1[0];
    }
    if (b1.size() > 1) {
      b = b1[b1.size() - 1] - b1[0];
    }
    if (c1.size() > 1) {
      c = c1.back() - c1.front();
    }
    int x = max(max(a, b), c);
    if (x == lim) break;
    int az = mx, bz = mx, cz = mx;
    if (a1.size() > 0) {
      az = as[a1[a1.size() - 1] + 1] - as[a1[0]];
    }
    if (b1.size() > 0) {
      bz = bs[b1[b1.size() - 1] + 1] - bs[b1[0]];
    }
    if (c1.size() > 0) {
      cz = cs[c1[c1.size() - 1] + 1] - cs[c1[0]];
    }
    if (x > a) {
      a = lim;
      az = mx;
    }
    if (x > b) {
      b = lim;
      bz = mx;
    }
    if (x > c) {
      c = lim;
      cz = mx;
    }
    x += min(min(az, bz), cz);
    a += az;
    b += bz;
    c += cz;
    if (x == a) {
      ans += "a";
      while (b1.size() > 0 && b1[0] < a1[0]) b1.pop_front();
      while (b1.size() > 0 && b1[b1.size() - 1] > a1[a1.size() - 1])
        b1.pop_back();
      while (c1.size() > 0 && c1[0] < a1[0]) c1.pop_front();
      while (c1.size() > 0 && c1[c1.size() - 1] > a1[a1.size() - 1])
        c1.pop_back();
      a1.pop_front();
      a1.pop_back();
    } else if (x == b) {
      ans += "b";
      while (a1.size() > 0 && a1[0] < b1[0]) a1.pop_front();
      while (a1.size() > 0 && a1[a1.size() - 1] > b1[b1.size() - 1])
        a1.pop_back();
      while (c1.size() > 0 && c1[0] < b1[0]) c1.pop_front();
      while (c1.size() > 0 && c1[c1.size() - 1] > b1[b1.size() - 1])
        c1.pop_back();
      b1.pop_front();
      b1.pop_back();
    } else {
      ans += "c";
      while (b1.size() > 0 && b1[0] < c1[0]) b1.pop_front();
      while (b1.size() > 0 && b1[b1.size() - 1] > c1[c1.size() - 1])
        b1.pop_back();
      while (a1.size() > 0 && a1[0] < c1[0]) a1.pop_front();
      while (a1.size() > 0 && a1[a1.size() - 1] > c1[c1.size() - 1])
        a1.pop_back();
      c1.pop_front();
      c1.pop_back();
    }
  }
  string aux = ans;
  reverse(aux.begin(), aux.end());
  if (c1.size() > 0) {
    ans += "c";
  } else {
    if (b1.size() > 0) {
      ans += "b";
    } else {
      if (a1.size()) {
        ans += "a";
      }
    }
  }
  ans += aux;
  if (ans.size() >= (int)n / 2)
    cout << ans;
  else
    cout << "IMPOSSIBLE";
  return 0;
}