#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  deque<char> ans;
  auto try_id = [&](int x) {
    ans.clear();
    ans.push_back(s[x]);
    int itla, itlb, itlc, itra, itrb, itrc;
    itla = itlb = itlc = x - 1;
    itra = itrb = itrc = x + 1;
    while ((itla >= 0 and itra < n) or (itlb >= 0 and itrb < n) or
           (itlc >= 0 and itrc < n)) {
      while (itla >= 0 and s[itla] != 'a') {
        --itla;
      }
      while (itlb >= 0 and s[itlb] != 'b') {
        --itlb;
      }
      while (itlc >= 0 and s[itlc] != 'c') {
        --itlc;
      }
      while (itra < n and s[itra] != 'a') {
        ++itra;
      }
      while (itrb < n and s[itrb] != 'b') {
        ++itrb;
      }
      while (itrc < n and s[itrc] != 'c') {
        ++itrc;
      }
      int a = max(x - itla, itra - x), b = max(x - itlb, itrb - x),
          c = max(x - itlc, itrc - x);
      int m = min({a, b, c});
      if (m == a and itla >= 0 and itra < n) {
        ans.push_front('a');
        ans.push_back('a');
        --itla;
        ++itra;
        itlb = min(itlb, itla);
        itlc = min(itlc, itla);
        itrb = max(itrb, itra);
        itrc = max(itrc, itra);
      } else if (m == b and itlb >= 0 and itrb < n) {
        ans.push_front('b');
        ans.push_back('b');
        --itlb;
        ++itrb;
        itla = min(itla, itlb);
        itlc = min(itlb, itlc);
        itra = max(itra, itrb);
        itrc = max(itrb, itrc);
      } else if (m == c and itlc >= 0 and itrc < n) {
        ans.push_front('c');
        ans.push_back('c');
        --itlc;
        ++itrc;
        itla = min(itla, itlc);
        itlb = min(itlb, itlc);
        itra = max(itra, itrc);
        itrb = max(itrb, itrc);
      }
    }
    return ans.size() >= n / 2;
  };
  for (int i = 0; i < 100; ++i) {
    if (n / 2 - i >= 0 and try_id(n / 2 - i)) {
      cout << string(ans.begin(), ans.end());
      return 0;
    }
    if (n / 2 + i < n and try_id(n / 2 + i)) {
      cout << string(ans.begin(), ans.end());
      return 0;
    }
  }
  cout << "IMPOSSIBLE";
  return 0;
}
