#include <bits/stdc++.h>
using namespace std;
const long long zero = 0;
const double PI = 3.14159265358979323846;
void solve() {
  long long n, m, a, b, k, x, y;
  string s;
  cin >> s;
  long long i = 0, j = s.size() - 1;
  string left;
  while (j - i >= 3) {
    if (s[i] == s[j]) {
      left.push_back(s[i]);
      i++, j--;
    } else if (s[i] == s[j - 1]) {
      left.push_back(s[i]);
      i++;
      j -= 2;
    } else {
      i++;
    }
  }
  string right = left;
  if (i <= j) left.push_back(s[i]);
  reverse((right).begin(), (right).end());
  string ans = left + right;
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
    cout << endl;
  }
  return 0;
}
