#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  string ans;
  int l = 0, r = s.size() - 1;
  bool flag = 0;
  char mid;
  while (l < r) {
    bool found = false;
    for (int i = 0; i < 2 && !found; ++i) {
      for (int j = 0; j < 2 && !found; ++j) {
        if (s[l + i] == s[r - j] && l + i < r - j) {
          ans.push_back(s[l + i]);
          l += i + 1;
          r -= j + 1;
          found = true;
        }
      }
    }
    if (l == r || (r - l <= 2 && !found)) {
      mid = s[l];
      flag = 1;
      break;
    }
  }
  s = ans;
  reverse(s.begin(), s.end());
  if (flag)
    ans = ans + mid + s;
  else
    ans = ans + s;
  cout << ans << "\n";
  return 0;
}
