#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  int l = 0, r = n - 1;
  string t = "";
  while (l + 2 < r) {
    if (s[l] != s[r]) {
      l++;
    }
    if (s[l] != s[r]) {
      r--;
    }
    if (s[l] != s[r]) {
      l--;
    }
    t += s[l];
    l++;
    r--;
  }
  cout << t;
  if (l <= r) {
    cout << s[l];
  }
  reverse(t.begin(), t.end());
  cout << t;
  return 0;
}
