#include <bits/stdc++.h>
using namespace std;
string s;
string answer;
void In() { cin >> s; }
void Solve() {
  int start = 0, finish = s.size() - 1;
  while (start + 1 < finish - 1) {
    if (s[start] == s[finish]) {
      answer.push_back(s[start]);
      start++;
      finish--;
    } else if (s[start] == s[finish - 1]) {
      answer.push_back(s[start]);
      start++;
      finish -= 2;
    } else {
      answer.push_back(s[start + 1]);
      start += 2;
      finish -= 2;
    }
  }
  int length = answer.length();
  answer.push_back(s[start]);
  for (int i = length - 1; i >= 0; i--) answer.push_back(answer[i]);
}
void Out() { cout << answer << endl; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  In();
  Solve();
  Out();
}
