#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int l = 0, r = N - 1;
  vector<char> L, R;
  while (l <= r) {
    if (S[l] == S[r]) {
      L.push_back(S[l]);
      if (l != r) R.push_back(S[r]);
      l++;
      r--;
    } else {
      if (S[l] == S[r - 1]) {
        L.push_back(S[l]);
        if (l != r - 1) R.push_back(S[r - 1]);
        l++;
        r -= 2;
      } else if (S[l + 1] == S[r]) {
        L.push_back(S[l + 1]);
        if (l + 1 != r) R.push_back(S[r]);
        l += 2;
        r--;
      } else if (S[l + 1] == S[r - 1]) {
        L.push_back(S[l + 1]);
        if (l + 1 != r - 1) R.push_back(S[r - 1]);
        l += 2;
        r -= 2;
      }
    }
  }
  reverse(R.begin(), R.end());
  for (auto x : L) cout << x;
  for (auto x : R) cout << x;
  cout << endl;
}
