#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
char en = '\n';
long long inf = 1e16;
long long mod = 998244353;
long long power(long long x, long long n, long long mod) {
  long long res = 1;
  x %= mod;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
bool check(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long n = s.length();
  char arr[n + 5];
  for (long long i = 1; i <= n; i++) arr[i] = s[i - 1];
  long long nxt[n + 5][3];
  nxt[n + 1][0] = nxt[n + 1][1] = nxt[n + 1][2] = inf;
  for (long long i = n; i >= 1; i--) {
    for (long long j = 0; j < 3; j++) nxt[i][j] = nxt[i + 1][j];
    nxt[i][arr[i] - 'a'] = i;
  }
  long long prev1[n + 5][3];
  prev1[0][0] = prev1[0][1] = prev1[0][2] = -inf;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 3; j++) prev1[i][j] = prev1[i - 1][j];
    prev1[i][arr[i] - 'a'] = i;
  }
  long long st = 1, end1 = n;
  string first1 = "", mid = "";
  while (st <= end1) {
    if (st == end1) {
      mid = arr[st];
      break;
    }
    long long min1 = inf;
    long long indx = -1;
    for (long long j = 0; j < 3; j++) {
      min1 = min(min1, (nxt[st][j] - st) + (end1 - prev1[end1][j]));
      if (min1 == ((nxt[st][j] - st) + (end1 - prev1[end1][j]))) indx = j;
    }
    st = nxt[st][indx];
    end1 = prev1[end1][indx];
    if (st == end1)
      mid = (char)('a' + indx);
    else
      first1 += (char)('a' + indx);
    st++;
    end1--;
  }
  string res = "";
  string last1 = "";
  last1 = first1;
  reverse(last1.begin(), last1.end());
  res = first1 + mid + last1;
  long long limit = n / 2;
  if (res.size() >= limit)
    cout << res << en;
  else
    cout << "IMPOSSIBLE" << en;
  return 0;
}
