#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
char str[N];
int main() {
  scanf(" %s", str);
  int n = strlen(str);
  int i = 0, j = n - 1;
  string x;
  while (i < j) {
    if (str[i] == str[j]) {
      printf("%c", str[i]);
      x.push_back(str[i]);
      i++, j--;
    } else if (str[i + 1] == str[j])
      i++;
    else if (str[i] == str[j - 1])
      j--;
    else
      i++, j--;
  }
  if (i == j) printf("%c", str[i]);
  reverse(x.begin(), x.end());
  printf("%s\n", x.c_str());
}
