#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  bool first = true;
  for (const auto& j : v) {
    if (!first) {
      os << " ";
    }
    first = false;
    os << j;
  }
  os << "\n";
  return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& elem : v) {
    is >> elem;
  }
  return is;
}
bool is_p(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  string g = "";
  for (int i = 0; i + 1 < n / 2; i += 2) {
    if (s[i] == s[n - i - 1]) {
      g += s[i];
    } else if (s[i] == s[n - i - 2]) {
      g += s[i];
    } else {
      g += s[i + 1];
    }
  }
  string gg = g;
  reverse(gg.begin(), gg.end());
  if (n % 4 > 0) {
    cout << g + s[n / 2] + gg;
  } else {
    cout << g + gg;
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  if (0) {
    int tests;
    cin >> tests;
    while (tests--) {
      solve();
      cout << "\n";
    }
  } else {
    solve();
    cout << endl;
  }
  return 0;
}
