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 IsPalin(const string& T) {
  int L = T.size();
  for (int i = 0; i < L; i++)
    if (T[i] != T[L - 1 - i]) return false;
  return true;
}
string SolveBrute(const string& S) {
  int L = S.size();
  for (int mask = 0; mask < (1 << L); mask++) {
    if (__builtin_popcount(mask) < L / 2) continue;
    string T = "";
    for (int i = 0; i < S.size(); i++) {
      if ((mask >> i) & 1) {
        T.push_back(S[i]);
      }
    }
    if (IsPalin(T)) {
      return T;
    }
  }
  exit(-1);
  return "none";
}
int last_c[1111111][3];
int first_c[1111111][3];
int main() {
  string S;
  cin >> S;
  int n = S.size();
  last_c[0][0] = last_c[0][1] = last_c[0][2] = -1;
  for (int i = 1; i <= n; i++) {
    for (int c = 0; c < 3; c++) {
      if (S[i - 1] == c + 'a') {
        last_c[i][c] = i;
      } else {
        last_c[i][c] = last_c[i - 1][c];
      }
    }
  }
  first_c[n + 1][0] = first_c[n + 1][1] = first_c[n + 1][2] = -1;
  for (int i = n; i >= 1; i--) {
    for (int c = 0; c < 3; c++) {
      if (S[i - 1] == c + 'a') {
        first_c[i][c] = i;
      } else {
        first_c[i][c] = first_c[i + 1][c];
      }
    }
  }
  int st = 1;
  int en = n;
  string ans = "";
  string ans_rev = "";
  while (ans.size() + ans_rev.size() < n / 2) {
    int maxlen = 0;
    int copt = -1;
    int n_st_opt = -1;
    int n_en_opt = -1;
    for (int c = 0; c < 3; c++) {
      int n_st = first_c[st][c];
      int n_en = last_c[en][c];
      if (n_st != -1 && n_en != -1 && n_en - n_st + 1 > maxlen) {
        maxlen = n_en - n_st + 1;
        copt = c;
        n_st_opt = n_st;
        n_en_opt = n_en;
      }
    }
    ans.push_back(copt + 'a');
    if (n_st_opt != n_en_opt) ans_rev.push_back(copt + 'a');
    if (S[n_st_opt - 1] != copt + 'a') exit(-1);
    if (S[n_en_opt - 1] != copt + 'a') exit(-1);
    st = n_st_opt + 1;
    en = n_en_opt - 1;
  }
  std::reverse(ans_rev.begin(), ans_rev.end());
  cout << ans + ans_rev << endl;
  return 0;
  while (0) {
    string S;
    cin >> S;
    cout << S << endl;
    cout << SolveBrute(S) << endl;
    cout << endl;
  }
  while (1) {
    int L = 10;
    string S;
    for (int i = 0; i < L; i++) {
      char c;
      while (1) {
        c = rand() % 3 + 'a';
        if (i > 0 && S.back() == c) continue;
        break;
      }
      S.push_back(c);
    }
    cout << S << endl;
    cout << SolveBrute(S) << endl;
    cout << endl;
  }
}