#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  int p = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') p = -p;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch - '0'), ch = getchar();
  x = x * p;
}
const int maxn = 1000005;
char s[maxn];
int n, cs[maxn], nowl, nowr;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  nowl = 1, nowr = n;
  while (nowr - nowl + 1 >= 4) {
    if (s[nowl] == s[nowr])
      cs[nowl] = cs[nowr] = 1, nowl++, nowr--;
    else if (s[nowl + 1] == s[nowr])
      cs[nowl + 1] = cs[nowr] = 1, nowl += 2, nowr--;
    else if (s[nowl] == s[nowr - 1])
      cs[nowl] = cs[nowr - 1] = 1, nowl++, nowr -= 2;
    else if (s[nowl + 1] == s[nowr - 1])
      cs[nowl + 1] = cs[nowr - 1] = 1, nowl += 2, nowr -= 2;
  }
  if (nowl != nowr) cs[nowl] = 1;
  for (int i = 1; i <= n; ++i)
    if (cs[i]) printf("%c", s[i]);
}
