#include <bits/stdc++.h>
using namespace std;
const int N = 2605;
int dp[N][N];
int path[N][N];
string str;
vector<char> res;
void getstr(int x, int y) {
  if (path[x][y] == 0) {
    getstr(x - 1, y - 1);
    res.push_back(str[x - 1]);
  } else if (path[x][y] == 1) {
    getstr(x - 1, y);
  } else if (path[x][y] == 2) {
    getstr(x, y - 1);
  }
}
void solve(string str2) {
  string str1 = str2;
  reverse(str1.begin(), str1.end());
  memset(dp, 0, sizeof(dp));
  memset(path, -1, sizeof(path));
  int n = str1.length();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int ii = i - 1;
      int jj = j - 1;
      if (str2[ii] == str1[jj]) {
        path[i][j] = 0;
        dp[i][j] = dp[ii][jj] + 1;
      } else {
        if (dp[ii][j] > dp[i][jj]) {
          dp[i][j] = dp[ii][j];
          path[i][j] = 1;
        } else {
          dp[i][j] = dp[i][jj];
          path[i][j] = 2;
        }
      }
    }
  }
  getstr(n, n);
  if (res.size() < 100) {
    for (int i = 0; i < res.size(); i++) {
      cout << res[i];
    }
  } else {
    for (int i = 0; i < 50; i++) {
      cout << res[i];
    }
    for (int i = res.size() - 50; i < res.size(); i++) {
      cout << res[i];
    }
  }
  cout << endl;
}
int main() {
  cin >> str;
  if (str.length() < N) {
    solve(str);
  } else {
    int cont[30];
    memset(cont, 0, sizeof(cont));
    for (int i = 0; i < str.length(); i++) {
      cont[str[i] - 'a']++;
    }
    int maxs = -1;
    for (int i = 0; i < 26; i++)
      if (cont[i] >= 100) maxs = i;
    char ch = 'a' + maxs;
    for (int i = 0; i < 100; i++) cout << ch;
    cout << endl;
  }
  return 0;
}
