#include <bits/stdc++.h>
using namespace std;
char s[1000005];
vector<char> ans;
int main() {
  int i, j, n;
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (i = 1, j = n; j - i + 1 >= 4; i += 2, j -= 2)
    if (s[i] == s[j] || s[i] == s[j - 1])
      ans.push_back(s[i]);
    else
      ans.push_back(s[i + 1]);
  if (i <= j) {
    for (int k = i; k <= j; k++)
      for (int l = k + 1; l <= j; l++)
        if (s[k] == s[l]) {
          ans.push_back(s[k]);
          i = k;
          j = k - 1;
          break;
        }
  }
  if (ans.size() * 2 + (i <= j) < n / 2) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  for (auto i : ans) printf("%c", i);
  if (i <= j) printf("%c", s[i]);
  reverse(ans.begin(), ans.end());
  for (auto i : ans) printf("%c", i);
  printf("\n");
  return 0;
}
