#include <bits/stdc++.h>
using namespace std;
string s, ans;
int main() {
  cin >> s;
  for (int state = 1; state < (1 << (s.size())); state++) {
    string temp = "", rev = "";
    for (int i = 0; i < s.size(); i++)
      if ((state >> i) & 1) temp += s[i];
    for (int i = 0; i < temp.size(); i++) rev += temp[temp.size() - 1 - i];
    if (temp == rev && temp > ans) ans = temp;
  }
  cout << ans << endl;
  return 0;
}
