#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long powermod(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool isprime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long n = s.size();
  long long low = 0, high = n - 1;
  vector<long long> vis(n, 0);
  while (low <= high) {
    if (low == high) {
      vis[low] = 1;
      break;
    } else if (s[low] == s[high]) {
      vis[low] = 1;
      vis[high] = 1;
      low++;
      high--;
    } else if (s[low + 1] == s[high]) {
      vis[low + 1] = 1;
      vis[high] = 1;
      low += 2;
      high--;
    } else if (s[low] == s[high - 1]) {
      vis[low] = 1;
      vis[high - 1] = 1;
      low++;
      high -= 2;
    } else {
      low++;
      high--;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (vis[i]) cout << s[i];
  }
  return 0;
}
