#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s, res = "";
  cin >> s;
  long long int i = 0, j = (long long int)s.size() - 1,
                k = (long long int)s.size() / 2, f = 0;
  while (k > 0) {
    if (j - i + 1 <= 3) {
      res += s[i];
      k--;
      f = 1;
    } else if (s[i] == s[j]) {
      res += s[i];
      k -= 2;
      i++;
      j--;
    } else if (s[i + 1] == s[j]) {
      res += s[i + 1];
      k -= 2;
      i += 2;
      j--;
    } else if (s[i] == s[j - 1]) {
      res += s[i];
      k -= 2;
      i++;
      j -= 2;
    } else if (s[i + 1] == s[j - 1]) {
      res += s[i + 1];
      k -= 2;
      i += 2;
      j -= 2;
    }
  }
  cout << res;
  reverse(res.begin(), res.end());
  if (f == 1) {
    cout << res.substr(1, (long long int)res.size() - 1);
  } else
    cout << res;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
}
