#include <bits/stdc++.h>
using namespace std;
long long const mod = 1e9 + 7;
long long const size_1d = 1e6 + 7;
long long const size_2d = 1e3 + 7;
long long power(long long x, long long y, long long mod = 2e18) {
  long long ans = 1;
  x %= mod;
  while (y) {
    if (y & 1) ans = (x * ans) % mod;
    x = (x * x) % mod;
    y >>= 1;
  }
  return ans;
}
long long modInverse(long long a, long long m) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long gcdext(long long a, long long b, long long *x = 0, long long *y = 0) {
  if (a == 0) {
    *x = 0;
    *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd1 = gcdext(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd1;
}
int randomize() { return (rand() % 10000); }
void answer(int a, char c) {
  for (int i = 0; i < a; ++i) {
    cout << c;
  }
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  std::vector<int> cs;
  std::vector<int> bs;
  std::vector<int> as;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == 'c') cs.push_back(i);
    if (s[i] == 'a') as.push_back(i);
    if (s[i] == 'b') bs.push_back(i);
  }
  if (bs.size() >= s.length() / 2) {
    answer(bs.size(), 'b');
    return 0;
  }
  if (cs.size() >= s.length() / 2) {
    answer(cs.size(), 'c');
    return 0;
  }
  if (as.size() >= s.length() / 2) {
    answer(as.size(), 'a');
    return 0;
  }
  string ans = "";
  int low = 0, high = s.size() - 1;
  string a;
  while (high - low >= 3) {
    if (s[low] == s[high]) {
      a.push_back(s[low]);
      low++;
      high--;
    } else if (s[low] == s[high - 1]) {
      a.push_back(s[low]);
      low++;
      high -= 2;
    } else {
      a.push_back(s[low + 1]);
      if (s[low + 1] == s[high]) {
        high--;
      } else {
        high -= 2;
      }
      low += 2;
    }
  }
  string b = a;
  if (low <= high) {
    a.push_back(s[low]);
  }
  reverse(b.begin(), b.end());
  cout << a + b << endl;
  return 0;
}
