#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 9;
const int inf = 1e9 + 9;
const int N = 3e3 + 9;
int dp[N][N];
int hash[N][N], h[N];
int d[N][N], d2[N][N];
string str, ans, ans2;
void print() {
  int bas = 0, son = str.size() - 1;
  while (bas <= son) {
    if (bas == son) {
      ans += str[bas];
      break;
    } else if (d[bas][son] == 1) {
      ans += str[bas];
      ans2 += str[son];
      bas++, son--;
    } else if (d[bas][son] == 2)
      son--;
    else
      bas++;
    if (ans.size() + ans2.size() == 100) break;
  }
  reverse(ans2.begin(), ans2.end());
  cout << ans << ans2 << endl;
}
int f(int bas, int son) {
  int &r = dp[bas][son];
  if (r != -1) return r;
  if (bas > son or son < bas or bas >= str.size() or son < 0) return r = 0;
  if (bas == son) {
    return r = 1;
  }
  if (str[bas] == str[son]) {
    r = 1;
    r += f(bas + 1, son - 1);
    r++;
    d[bas][son] = 1;
  } else {
    int mx1 = f(bas, son - 1);
    int mx2 = f(bas + 1, son);
    if (mx1 > mx2)
      d[bas][son] = 2;
    else
      d[bas][son] = 3;
    r = max(mx1, mx2);
  }
  return r;
}
int main() {
  cin >> str;
  for (int i = 0; i < str.size(); i++) h[str[i]]++;
  for (int i = 0; i < 26; i++) {
    if (h[i + 'a'] >= 100) {
      for (int j = 1; j <= min(100, h[i + 'a']); j++) {
        cout << (char)(i + 'a');
      }
      return 0;
    }
  }
  memset(dp, -1, sizeof dp);
  f(0, str.size() - 1);
  print();
  return 0;
}
