#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string k;
  cin >> k;
  string beg = "";
  int bei = 0;
  bool need = false;
  char old;
  int endi = k.size() - 1;
  for (int i = 0; 2 * beg.size() < k.size() / 2; ++i) {
    if (bei > endi) {
      break;
    }
    if (bei == endi) {
      need = true;
      old = k[bei];
      break;
    }
    if (k[bei] == k[endi]) {
      beg += k[bei];
      ++bei;
      --endi;
      continue;
    }
    if (bei + 1 == endi) {
      need = true;
      old = k[bei];
      break;
    }
    if (k[bei + 1] == k[endi]) {
      beg += k[bei + 1];
      bei += 2;
      --endi;
      continue;
    }
    if (k[bei] == k[endi - 1]) {
      beg += k[bei];
      ++bei;
      endi -= 2;
      continue;
    }
    if (bei + 1 == endi - 1) {
      need = true;
      old = k[bei + 1];
      break;
    }
    if (k[bei + 1] == k[endi - 1]) {
      beg += k[bei + 1];
      bei += 2;
      endi -= 2;
      continue;
    }
  }
  if (2 * beg.size() + need >= k.size() / 2) {
    cout << beg;
    if (need) {
      cout << old;
    }
    reverse(beg.begin(), beg.end());
    cout << beg;
  } else {
    cout << "IMPOSSIBLE";
  }
}
