#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
long long n, tsize;
char s[maxn], t[maxn];
char c;
int32_t main() {
  scanf("%s", s);
  n = strlen(s);
  long long l = 0, r = n - 1;
  while (1) {
    if (r - l <= 2) {
      c = s[l];
      break;
    }
    if (s[l] == s[r]) {
      t[tsize++] = s[l];
      l++, r--;
      continue;
    }
    if (s[l] == s[r - 1]) {
      t[tsize++] = s[l];
      l++;
      r -= 2;
      continue;
    }
    if (s[l + 1] == s[r]) {
      t[tsize++] = s[r];
      l += 2;
      r--;
      continue;
    }
    t[tsize++] = s[l + 1];
    l += 2;
    r -= 2;
  }
  printf("%s", t);
  if (c != 0) {
    printf("%c", c);
  }
  for (long long i = tsize - 1; i >= 0; i--) {
    printf("%c", t[i]);
  }
  printf("\n");
}
