#include <bits/stdc++.h>
using namespace std;
string s[6];
int main(int argc, char const *argv[]) {
  string sx;
  cin >> sx;
  deque<char> dq;
  for (auto i : sx) {
    dq.push_back(i);
  }
  queue<char> l;
  stack<char> r;
  while (dq.size() >= 4) {
    char ccnt[4] = {0, 0, 0, 0};
    ccnt[dq.front() - 'a']++;
    dq.pop_front();
    ccnt[dq.front() - 'a']++;
    dq.pop_front();
    ccnt[dq.back() - 'a']++;
    dq.pop_back();
    ccnt[dq.back() - 'a']++;
    dq.pop_back();
    for (int i = 0; i < 4; i++) {
      if (ccnt[i] >= 2) {
        l.push('a' + i);
        r.push('a' + i);
        break;
      }
    }
  }
  while (!l.empty()) {
    cout << l.front();
    l.pop();
  }
  if (!dq.empty()) {
    cout << dq.front();
  }
  while (!r.empty()) {
    cout << r.top();
    r.pop();
  }
  cout << endl;
  return 0;
}
