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;
const long long N = 100005;
char en = '\n';
long long inf = 1e16;
long long mod = 998244353;
long long power(long long x, long long n, long long mod) {
  long long res = 1;
  x %= mod;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
bool check(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long n = s.length();
  char arr[n + 5];
  for (long long i = 1; i <= n; i++) arr[i] = s[i - 1];
  long long nxt[n + 5][3];
  nxt[n + 1][0] = nxt[n + 1][1] = nxt[n + 1][2] = inf;
  for (long long i = n; i >= 1; i--) {
    for (long long j = 0; j < 3; j++) nxt[i][j] = nxt[i + 1][j];
    nxt[i][arr[i] - 'a'] = i;
  }
  long long prev1[n + 5][3];
  prev1[0][0] = prev1[0][1] = prev1[0][2] = -inf;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 3; j++) prev1[i][j] = prev1[i - 1][j];
    prev1[i][arr[i] - 'a'] = i;
  }
  long long st = 1, end1 = n;
  string first1 = "", mid = "";
  while (st <= end1) {
    if (st == end1) {
      mid = arr[st];
      break;
    }
    long long min1 = inf;
    long long indx = -1;
    for (long long j = 0; j < 3; j++) {
      min1 = min(min1, (nxt[st][j] - st) + (end1 - prev1[end1][j]));
      if (min1 == ((nxt[st][j] - st) + (end1 - prev1[end1][j]))) indx = j;
    }
    st = nxt[st][indx];
    end1 = prev1[end1][indx];
    if (st == end1)
      mid = (char)('a' + indx);
    else
      first1 += (char)('a' + indx);
    st++;
    end1--;
  }
  string res = "";
  string last1 = "";
  last1 = first1;
  reverse(last1.begin(), last1.end());
  res = first1 + mid + last1;
  long long limit = n / 2;
  if (res.size() >= limit)
    cout << res << en;
  else
    cout << "IMPOSSIBLE" << en;
  return 0;
}