#include <bits/stdc++.h>
using namespace std;
bool palindrome(string& str) {
  for (int i = 0, j = (int)str.size() - 1; i < j; i++, j--)
    if (str[i] != str[j]) return false;
  return true;
}
string solve(string s) {
  int n = s.size(), comb = 1 << n;
  string ans;
  for (int i = 0; i < comb; i++) {
    string tmp;
    for (int j = 0; j < n; j++)
      if ((i >> j) & 1) tmp += s[j];
    if (palindrome(tmp)) ans = max(ans, tmp);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  cout << solve(s) << endl;
  return 0;
}
