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 INF = 2e18;
bool prime[100010];
void SieveOfEratosthenes(long long n) {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long power1(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
    }
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long mod_power(long long a, long long b, long long m) {
  long long res = 1;
  a %= m;
  while (b) {
    if (b & 1) {
      res = res * a % m;
    }
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long printDivisors(long long n) {
  long long count = 0;
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        count++;
      else
        printf("%d %d ", i, n / i);
    }
  }
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (s.length() < 4) {
    cout << s[0] << endl;
    return 0;
  }
  vector<long long> a, b, c;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == 'a')
      a.push_back(i);
    else if (s[i] == 'b')
      b.push_back(i);
    else
      c.push_back(i);
  }
  long long a1 = -1, a2 = -1, b1 = -1, b2 = -1, c1 = -1, c2 = -1;
  long long al1 = -1, al2 = -1, bl1 = -1, bl2 = -1, cl1 = -1, cl2 = -1;
  if (a.size()) {
    a1 = 0;
    a2 = a.size() - 1;
  }
  if (b.size()) {
    b1 = 0;
    b2 = b.size() - 1;
  }
  if (c.size()) {
    c1 = 0;
    c2 = c.size() - 1;
  }
  long long size = s.length() / 2;
  string ans;
  ans.resize(size);
  bool flag = true;
  long long num = size;
  long long lprev, rprev;
  for (long long i = 0; i < num / 2; i++) {
    if (!flag) break;
    if (i == 0) {
      if (a.size() && b.size() && c.size()) {
        if ((a[a2] - a[a1]) >= (b[b2] - b[b1]) &&
            (a[a2] - a[a1]) >= (c[c2] - c[c1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (b[b2] - b[b1]) &&
                   (b[b2] - b[b1]) >= (c[c2] - c[c1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else if ((c[c2] - c[c1]) >= (b[b2] - b[b1]) &&
                   (a[a2] - a[a1]) <= (c[c2] - c[c1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!a.size()) {
        if ((b[b2] - b[b1]) >= (c[c2] - c[c1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else if ((c[c2] - c[c1]) >= (b[b2] - b[b1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!b.size()) {
        if ((a[a2] - a[a1]) >= (c[c2] - c[c1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (c[c2] - c[c1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!c.size()) {
        if ((a[a2] - a[a1]) >= (b[b2] - b[b1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (b[b2] - b[b1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else {
          flag = false;
          break;
        }
      }
    } else {
      while (a.size() && a[a1] < lprev && a1 < a2) a1++;
      while (b.size() && b[b1] < lprev && b1 < b2) b1++;
      while (c.size() && c[c1] < lprev && c1 < c2) c1++;
      while (a.size() && a[a2] > rprev && a1 < a2) a2--;
      while (b.size() && b[b2] > rprev && b1 < b2) b2--;
      while (c.size() && c[c2] > rprev && c1 < c2) c2--;
      if (a.size() && b.size() && c.size()) {
        if ((a[a2] - a[a1]) >= (b[b2] - b[b1]) &&
            (a[a2] - a[a1]) >= (c[c2] - c[c1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (b[b2] - b[b1]) &&
                   (b[b2] - b[b1]) >= (c[c2] - c[c1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else if ((c[c2] - c[c1]) >= (b[b2] - b[b1]) &&
                   (a[a2] - a[a1]) <= (c[c2] - c[c1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!a.size()) {
        if ((b[b2] - b[b1]) >= (c[c2] - c[c1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else if ((c[c2] - c[c1]) >= (b[b2] - b[b1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!b.size()) {
        if ((a[a2] - a[a1]) >= (c[c2] - c[c1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (c[c2] - c[c1])) {
          ans[i] = 'c';
          ans[size - 1 - i] = 'c';
          cl1 = c1;
          cl2 = c2;
          lprev = c[c1];
          rprev = c[c2];
          c1++;
          c2--;
          if (c1 > c2) c1 = c2 = 0;
        } else {
          flag = false;
          break;
        }
      } else if (!c.size()) {
        if ((a[a2] - a[a1]) >= (b[b2] - b[b1])) {
          ans[i] = 'a';
          ans[size - 1 - i] = 'a';
          al1 = a1;
          al2 = a2;
          lprev = a[a1];
          rprev = a[a2];
          a1++;
          a2--;
          if (a1 > a2) a1 = a2 = 0;
        } else if ((a[a2] - a[a1]) <= (b[b2] - b[b1])) {
          ans[i] = 'b';
          ans[size - 1 - i] = 'b';
          bl1 = b1;
          bl2 = b2;
          lprev = b[b1];
          rprev = b[b2];
          b1++;
          b2--;
          if (b1 > b2) b1 = b2 = 0;
        } else {
          flag = false;
          break;
        }
      }
    }
  }
  if (size % 2 && rprev - lprev < 2) flag = false;
  if (!flag) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  if (size % 2) ans[size / 2] = s[lprev + 1];
  cout << ans << endl;
}