#include <bits/stdc++.h>
using namespace std;
int n;
string a;
vector<int> v;
int nxt[1000007][3];
int prv[1000007][3];
void input() {
  cin >> a, n = a.size();
  int lst[3];
  lst[0] = lst[1] = lst[2] = n;
  for (int i = n - 1; i >= 0; --i) {
    int val = (a[i] - 'a');
    lst[val] = i;
    for (int j = 0; j < 3; ++j) {
      nxt[i][j] = lst[j];
    }
  }
  lst[0] = lst[1] = lst[2] = 0;
  for (int i = 0; i < n; ++i) {
    int val = (a[i] - 'a');
    lst[val] = i;
    for (int j = 0; j < 3; ++j) {
      prv[i][j] = lst[j];
    }
  }
}
void solve() {
  int l, r;
  l = 0;
  r = n - 1;
  while (r > l) {
    if (a[l] == a[r]) {
      v.push_back(l);
      v.push_back(r);
      ++l, --r;
    } else {
      if (a[r - 1] == a[l + 1]) {
        ++l;
        --r;
      } else if (a[r - 1] == a[l]) {
        --r;
      } else {
        ++l;
      }
    }
  }
  if (l == r) {
    v.push_back(l);
  }
  sort(v.begin(), v.end());
  int sz = v.size();
  if (n / 2 <= sz) {
    for (int i = 0; i < sz; ++i) {
      cout << a[v[i]];
    }
    cout << "\n";
  } else {
    printf("IMPOSSIBLE\n");
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  solve();
  return 0;
}
