#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000000 + 7;
const long long alphabet = 256;
int dp[26];
string lcs(string X, string Y) {
  int m = X.length();
  int n = Y.length();
  int L[m + 1][n + 1];
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j <= n; j++) {
      if (i == 0 || j == 0)
        L[i][j] = 0;
      else if (X[i - 1] == Y[j - 1])
        L[i][j] = L[i - 1][j - 1] + 1;
      else
        L[i][j] = max(L[i - 1][j], L[i][j - 1]);
    }
  }
  int index = L[m][n];
  string lcs(index + 1, ' ');
  int i = m, j = n;
  while (i > 0 && j > 0) {
    if (X[i - 1] == Y[j - 1]) {
      lcs[index - 1] = X[i - 1];
      i--;
      j--;
      index--;
    } else if (L[i - 1][j] > L[i][j - 1])
      i--;
    else
      j--;
  }
  return lcs;
}
string longestPalSubseq(string str) {
  string rev = str;
  reverse(rev.begin(), rev.end());
  return lcs(str, rev);
}
int main() {
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    dp[s[i] - 'a']++;
  }
  for (int i = 0; i < 26; i++) {
    if (dp[i] >= 100) {
      char c = 'a' + i;
      for (int j = 0; j < 100; j++) {
        cout << c;
      }
      return 0;
    }
  }
  string temp = longestPalSubseq(s);
  int l = temp.length();
  l--;
  string ans = temp.substr(0, l);
  if (l <= 100)
    cout << ans;
  else {
    int len = 50;
    for (int i = 0; i < 50; i++) cout << ans[i];
    for (int i = l - 50; i < l; i++) cout << ans[i];
  }
}
