#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char s[N];
char ans[N];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  int l = 0, r = n - 1;
  int m = 0;
  while (l < r) {
    if (s[l] == s[r]) {
      ans[m++] = s[l];
      ++l, --r;
    } else {
      if (r - l <= 2)
        r = l;
      else {
        if (s[l] == s[r - 1]) {
          ans[m++] = s[l];
          ++l, r -= 2;
        } else if (s[l + 1] == s[r]) {
          ans[m++] = s[l + 1];
          l += 2, --r;
        } else {
          ans[m++] = s[l + 1];
          l += 2, r -= 2;
        }
      }
    }
  }
  if (l == r) {
    if (2 * m + 1 >= n / 2) {
      for (int i = 0; i < m; ++i) printf("%c", ans[i]);
      printf("%c", s[l]);
      for (int i = m - 1; i >= 0; --i) printf("%c", ans[i]);
      printf("\n");
    } else
      printf("IMPOSSIBLE\n");
  } else {
    if (2 * m >= n / 2) {
      for (int i = 0; i < m; ++i) printf("%c", ans[i]);
      for (int i = m - 1; i >= 0; --i) printf("%c", ans[i]);
      printf("\n");
    } else
      printf("IMPOSSIBLE\n");
  }
  return 0;
}
