#include <bits/stdc++.h>
using namespace std;
bool isrange(int second, int first, int n, int m) {
  if (0 <= second && second < n && 0 <= first && first < m) return true;
  return false;
}
int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1},
    ddy[8] = {1, 0, -1, 0, 1, 1, -1, -1}, ddx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int cnt[26];
int lp[3];
vector<int> v[3];
string ans = "";
int main(void) {
  string s;
  cin >> s;
  for (int e = 0; e < (int)s.size(); e++) cnt[(int)(s[e] - 'a')]++;
  for (int l = 0, r = (int)s.size() - 1; l <= r;) {
    if (s[l] == s[r]) {
      ans += s[l];
      l++;
      r--;
    } else if (s[l + 1] == s[r])
      l++;
    else if (s[l] == s[r - 1])
      r--;
    else {
      l++;
      r--;
    }
  }
  string ans2 = ans;
  for (int e = (int)ans2.size() - 2; e >= 0; e--) ans += ans2[e];
  cout << ans;
  return 0;
}
