#include <bits/stdc++.h>
using namespace std;
string s, ANS;
int main() {
  cin >> s;
  int i = 0, j = s.size() - 1;
  while (j - i >= 3) {
    if (s[i] == s[j])
      ANS += s[i], ++i, --j;
    else if (s[i] == s[j - 1])
      ANS += s[i], ++i, j -= 2;
    else if (s[i + 1] == s[j])
      ANS += s[i + 1], i += 2, --j;
    else if (s[i + 1] == s[j - 1])
      ANS += s[i + 1], i += 2, j -= 2;
  }
  cout << ANS;
  if (i <= j) cout << s[i];
  reverse(ANS.begin(), ANS.end());
  cout << ANS;
}
