#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2600;
const int ALPH = 26;
void solve() {
  string s, answer;
  cin >> s;
  int sz = s.size();
  if (sz >= MAX_N) {
    int freq[ALPH];
    memset(freq, 0, sizeof(freq));
    for (int i = 0; i < sz; i++) {
      int c = s[i] - 'a';
      freq[c]++;
    }
    for (int i = 0; i < ALPH; i++) {
      if (freq[i] >= 100) {
        answer = "";
        for (int j = 0; j < 100; j++) answer += char('a' + i);
      }
      break;
    }
  } else {
    int dp[sz][sz];
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i < sz; i++) dp[i][i] = 1;
    for (int l = 2; l <= sz; l++) {
      for (int i = 0; i + l - 1 < sz; i++) {
        int j = i + l - 1;
        if (s[i] == s[j])
          dp[i][j] = dp[i + 1][j - 1] + 2;
        else
          dp[i][j] = max(dp[i][j - 1], dp[i + 1][j]);
      }
    }
    int left = 0;
    int right = sz - 1;
    while (dp[left][right] > 1) {
      if (2 * answer.size() == 100) break;
      if (s[left] == s[right]) {
        answer += s[left];
        left++;
        right--;
      } else {
        if (dp[left + 1][right] > dp[left][right - 1])
          left++;
        else
          right--;
      }
    }
    string r = answer;
    reverse(r.begin(), r.end());
    if (2 * answer.size() < 100 and left <= right and dp[left][right] == 1) {
      answer = answer + s[right] + r;
    } else {
      answer = answer + r;
    }
  }
  cout << answer << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
