#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, p, d;
  cin >> s;
  int n = s.size();
  int l = 0, r = n - 1;
  while (l < r) {
    if (r - l >= 3) {
      if (s[l] == s[r])
        p.push_back(s[l]);
      else if (s[l] == s[r - 1])
        p.push_back(s[l]);
      else if (s[l + 1] == s[r])
        p.push_back(s[l + 1]);
      else
        p.push_back(s[l + 1]);
    } else if (r - l < 3) {
      d.push_back(s[l]);
      break;
    }
    r = r - 2;
    l = l + 2;
  }
  if (l > r) {
    cout << p;
    reverse(p.begin(), p.end());
    cout << p << endl;
  } else {
    cout << p << d;
    reverse(p.begin(), p.end());
    cout << p << endl;
  }
  return 0;
}
