#include <bits/stdc++.h>
using namespace std;
string s, ans;
void solve(int index, string cur) {
  string aux = cur;
  reverse(cur.begin(), cur.end());
  if (cur == aux) {
    ans = max(cur, ans);
  }
  for (int i = index; i < s.size(); i++) {
    solve(i + 1, cur + s[i]);
  }
}
int main() {
  cin >> s;
  solve(0, "");
  cout << ans;
}
