#include <bits/stdc++.h>
std::string str, ans, cur;
int len;
std::string mask(std::string str, int m) {
  std::string ret;
  for (int i = 0; i < str.length(); ++i) {
    if (m & (1 << i)) {
      ret += str[i];
    }
  }
  return ret;
}
bool poli(std::string cur) {
  int l = cur.length();
  for (int i = 0; i < l / 2; ++i) {
    if (cur[i] != cur[l - i - 1]) return false;
  }
  return true;
}
bool more(std::string first, std::string second) {
  std::string::iterator f_it = first.begin(), s_it = second.begin();
  for (; f_it != first.end() && s_it != second.end(); ++f_it, ++s_it) {
    if (*f_it != *s_it) return *f_it > *s_it;
  }
  return (f_it != first.end());
}
int main() {
  std::cin >> str;
  for (int m = 1; m < (1 << str.length()); ++m) {
    cur = mask(str, m);
    if (poli(cur) && more(cur, ans)) {
      ans = cur;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
