#include <bits/stdc++.h>
using namespace std;
bool palindrome(string a) {
  string b = a;
  reverse(a.begin(), a.end());
  return a == b;
}
int main() {
  string a, ans, aux;
  cin >> a;
  for (int bit = 0; bit != (1 << a.size()); bit++) {
    aux = "";
    for (int i = 0; i < a.size(); i++) {
      if (bit & (1 << i)) {
        aux += a[i];
      }
    }
    if (palindrome(aux) && aux > ans) ans = aux;
  }
  cout << ans << endl;
}
