#include <bits/stdc++.h>
using namespace std;
const int maxx = 1e6 + 100;
string s;
int vis[maxx];
int main() {
  while (cin >> s) {
    int len = s.length();
    memset(vis, 0, sizeof(vis));
    int l = 0;
    int r = len - 1;
    while (l <= r) {
      if (l == r) {
        vis[l] = 1;
        break;
      }
      if (s[l] == s[r])
        vis[l] = vis[r] = 1;
      else if (s[l] == s[r - 1])
        vis[l] = vis[r - 1] = 1;
      else if (s[l + 1] == s[r])
        vis[l + 1] = vis[r] = 1;
      else if (s[l + 1] == s[r - 1])
        vis[l + 1] = vis[r - 1] = 1;
      l += 2;
      r -= 2;
    }
    for (int i = 0; i < len; i++)
      if (vis[i]) cout << s[i];
    cout << endl;
  }
}
