#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  string s, res = "";
  cin >> s;
  int len = s.length();
  if (len <= 3) {
    cout << s[0] << endl;
    return 0;
  }
  int l = 0, r = len - 1;
  while (l + 1 < r - 1) {
    if (s[l] == s[r] || s[l] == s[r - 1])
      res += s[l];
    else if (s[l + 1] == s[r] || s[l + 1] == s[r - 1])
      res += s[l + 1];
    l += 2, r -= 2;
  }
  string ch = "";
  if (l <= r) ch += s[l];
  string re_res = res;
  reverse(re_res.begin(), re_res.end());
  cout << res << ch << re_res << endl;
  return 0;
}
