#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
void solve() {
  char s[1000010] = {0};
  cin >> s;
  if (strlen(s) <= 3) {
    cout << s[0];
  } else {
    vector<char> v;
    int i = 0, j = strlen(s) - 1;
    while (j - i >= 3) {
      if (s[i] == s[j] || s[i] == s[j - 1])
        v.push_back(s[i]);
      else
        v.push_back(s[i + 1]);
      i += 2;
      j -= 2;
    }
    for (auto it = v.begin(); it != v.end(); it++) {
      cout << *it;
    }
    if (j - i > 0 && j - i < 3) {
      cout << s[i];
    } else if (j - i > 0 && j - i == 3) {
      cout << s[i] << s[i + 1];
    }
    while (!v.empty()) {
      cout << (v.back());
      v.pop_back();
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int test = 1;
  for (int t = 1; t <= test; ++t) {
    solve();
  }
}
