#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, p = "", q = "", r = "";
  cin >> s;
  int n = s.size();
  for (int i = 0; i < (n / 4) * 2; i += 2)
    if (s[i] == s[n - 1 - i] || s[i] == s[n - 2 - i])
      p += s[i];
    else
      p += s[i + 1];
  r = p;
  reverse(r.begin(), r.end());
  if (n % 4) q = s[(n / 4) * 2];
  cout << p + q + r << "\n";
  return 0;
}
