#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 77;
char S[N];
int T[3];
deque<char> A;
int n;
void Solve(int le, int ri) {
  if (ri == le) return;
  if (ri - le < 4) {
    A.push_back(S[le]);
    return;
  }
  Solve(le + 2, ri - 2);
  char x, xx, y, yy;
  x = S[le];
  xx = S[le + 1];
  y = S[ri - 2];
  yy = S[ri - 1];
  ++T[x - 'a'];
  ++T[xx - 'a'];
  ++T[yy - 'a'];
  ++T[y - 'a'];
  for (int i = 0; i < 3; ++i)
    if (T[i] > 1) {
      A.push_front((char)(i + 'a'));
      A.push_back((char)(i + 'a'));
      break;
    }
  T[0] = T[1] = T[2] = 0;
}
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  Solve(1, n + 1);
  for (char x : A) printf("%c", x);
  return 0;
}
