#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  string ans;
  long long len = s.length();
  long long index = (len - 1) / 2;
  long long l = index - 1, r = index + 1;
  while (l >= 0 && r < len) {
    if (s[l] == s[r]) {
      ans += s[l];
      l--, r++;
    } else if (r + 1 < len && s[l] == s[r + 1]) {
      ans += s[l];
      l--;
      r++;
      r++;
    } else if (l - 1 >= 0 && s[l - 1] == s[r]) {
      ans += s[r];
      l--;
      l--;
      r++;
    } else {
      l--;
      r++;
    }
  }
  string b = ans;
  reverse(b.begin(), b.end());
  ans = b + s[index] + ans;
  cout << ans;
  return 0;
}
