#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  long long int start = 0;
  long long int end = n - 1;
  vector<int> st;
  vector<int> e;
  while (start <= end) {
    if (start == end) {
      st.push_back(start);
      start++;
      end--;
    } else if (s[start] == s[end]) {
      st.push_back(start);
      e.push_back(end);
      start++;
      end--;
    } else if (start < end && s[start + 1] == s[end]) {
      start++;
    } else if (s[start] == s[end - 1]) {
      end--;
    } else {
      start++;
      end--;
    }
  }
  long long int p = st.size();
  long long int q = e.size();
  if (p + q < n / 2)
    cout << "IMPOSSIBLE";
  else {
    for (int i = 0; i < st.size(); i++) cout << s[st[i]];
    for (int i = e.size() - 1; i >= 0; i--) cout << s[e[i]];
  }
  return 0;
}
