#include <bits/stdc++.h>
using namespace std;
bool check(string s) {
  for (long long int i = 0; i < s.length(); i++) {
    if (s[i] != s[s.length() - 1 - i]) return 0;
  }
  return 1;
}
int32_t main() {
  string s;
  cin >> s;
  long long int n = s.length();
  long long int m = n;
  n = (1 << n);
  string ans = "";
  for (long long int i = 0; i < n; i++) {
    long long int k = i;
    string l = "";
    for (long long int j = 0; j < m; j++) {
      if (k % 2) {
        l = l + s[j];
      }
      k /= 2;
    }
    if (check(l)) {
      ans = max(ans, l);
    }
  }
  cout << ans << endl;
  return 0;
}
