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 int MAX_N = 1e6 + 5;
const double delta = 1e-6;
const long long mod = 1e9 + 7;
struct ev {
  double coord;
  int type;
  int mincost;
};
const bool operator<(const ev& f, const ev& s) { return f.coord < s.coord; }
void init() {}
class fenwick {
  vector<int> sums;

 public:
  fenwick(int n) { sums.resize(n + 3); }
  void add(int pos, int delta) {
    for (pos++; pos < sums.size(); pos += pos & (-pos)) sums[pos] += delta;
  }
  int size() { return sums.size() - 2; }
  int pref_sum(int pos) {
    if (pos < -1) return 0;
    int answer = 0;
    for (pos++; pos > 0; pos -= pos & (-pos)) answer += sums[pos];
    return answer;
  }
  int get_sum(int left, int right) {
    return pref_sum(right) - pref_sum(left - 1);
  }
};
const bool cmppp(const pair<int, int>& f, const pair<int, int>& s) {
  return (f.second == s.second) ? (f.first < s.first) : (f.second > s.second);
}
vector<int> unique_xs;
void compress() {
  sort(unique_xs.begin(), unique_xs.end());
  unique_xs = vector<int>(unique_xs.begin(),
                          unique(unique_xs.begin(), unique_xs.end()));
}
int get_num(int dt) {
  return lower_bound(unique_xs.begin(), unique_xs.end(), dt) -
         unique_xs.begin();
}
class dsu {
 public:
  vector<int> a;
  vector<int> sizes;
  dsu(int n, vector<int>& sizes) : sizes(sizes) {
    a.resize(n);
    for (int i = 0; i < n; i++) {
      a[i] = i;
    }
  }
  int get_parent(int x) { return (a[x] == x) ? x : (a[x] = get_parent(a[x])); }
  void unite(int l, int r) {
    int par_1 = get_parent(l);
    int par_2 = get_parent(r);
    if (par_1 == par_2) return;
    if (sizes[par_1] < sizes[par_2]) swap(par_1, par_2);
    sizes[par_1] += sizes[par_2];
    sizes[par_2] = 0;
    a[par_2] = par_1;
  }
};
bool is_prime(int number) {
  for (int i = 2; i * i <= number; i++) {
    if (number % i == 0) {
      return false;
    }
  }
  return true;
}
string s;
string left_answer = "";
string right_answer = "";
void squeeze(int& l, int& r) {
  if (l == r) {
    left_answer += s[l];
    l++;
    return;
  }
  if (s[l] == s[r]) {
    left_answer += s[l];
    right_answer += s[r];
    l++;
    r--;
    return;
  }
  if (l + 1 >= r && s[l] != s[r]) {
    left_answer += s[l];
    l++;
    r--;
    return;
  }
  if (s[l + 1] == s[r]) {
    left_answer += s[l + 1];
    right_answer += s[r];
    l += 2;
    r--;
    return;
  }
  if (s[l] == s[r - 1]) {
    left_answer += s[l];
    right_answer += s[r - 1];
    l++;
    r -= 2;
    return;
  }
  l++;
  r--;
}
void solve() {
  cin >> s;
  int left = 0;
  int right = s.size() - 1;
  while (left <= right) {
    squeeze(left, right);
  }
  reverse(right_answer.begin(), right_answer.end());
  cout << left_answer << right_answer << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(58164);
  solve();
}