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;
bool sBs(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long SUMD(long long n);
long long BS(vector<long long> &PS, long long s, long long e, long long ser);
long long MI(long long a, long long m);
bool P[100000LL + 1];
void Sieve(int n = 100000LL);
long long Powb(long long b, long long n);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long q = 1;
  while (q--) {
    long long b, w, n, m, k, i, j;
    string s;
    cin >> s;
    n = s.size();
    if (n <= 3) {
      cout << s[0] << "\n";
      return 0;
    }
    string ans = "", h = "", t = "";
    vector<long long> V(3);
    for (i = 0; i < n / 2 - 1; i += 2) {
      V[s[i] - 'a']++;
      V[s[i + 1] - 'a']++;
      V[s[n - i - 1] - 'a']++;
      V[s[n - i - 2] - 'a']++;
      for (j = 0; j < 3; j++) {
        if (V[j] >= 2) {
          h += ('a' + j);
          t += ('a' + j);
          break;
        }
      };
      for (long long i = 0; i < V.size(); i++) V[i] = 0;
      ;
    }
    if (n % 4 >= 2) h += s[n / 2];
    reverse(t.begin(), t.end());
    h += t;
    cout << h << "\n";
  }
  return 0;
}
long long Powb(long long b, long long n) {
  if (n == 0) return 1LL;
  if (n == 1) return b;
  long long temp = Powb(b, n / 2);
  if (n % 2 == 0) {
    return (temp * temp) % 1000000007;
  } else {
    return (b * ((temp * temp) % 1000000007)) % 1000000007;
  }
}
long long SUMD(long long n) {
  long long sum = 0;
  while (n > 0) {
    sum += n % 10;
    n = n / 10;
  }
  return sum;
}
long long BS(vector<long long> &PS, long long s, long long e, long long ser) {
  if (s > e) return s;
  long long mid = (s + e) / 2;
  if (PS[mid] == ser) {
    return mid;
  } else if (PS[mid] > ser) {
    return BS(PS, s, mid - 1, ser);
  } else
    return BS(PS, mid + 1, e, ser);
}
long long MI(long long a, long long m) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
void Sieve(int n) {
  memset(P, true, sizeof(P));
  P[0] = false;
  P[1] = false;
  for (long long i = 2; i * i <= n; i++) {
    if (P[i]) {
      for (long long j = i * i; j <= n; j += i) {
        P[j] = false;
      }
    }
  }
}