#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int main() {
  string s, temp;
  cin >> s;
  for (long long i = 0; i < pow(2, s.size()); i++) {
    string s1;
    long long num = i;
    while (num > 0) {
      if (num % 2 == 0) {
        s1 += '0';
      } else {
        s1 += '1';
      }
      num /= 2;
    }
    while (s1.size() < s.size()) {
      s1 += '0';
    }
    string s2;
    for (long long j = 0; j < s1.size(); j++) {
      if (s1[j] == '1') {
        s2 += s[j];
      }
    }
    long long flag = 0;
    for (long long j = 0; j <= s2.size() / 2; j++) {
      if (s2[j] != s2[s2.size() - 1 - j]) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      continue;
    }
    if (s2 > temp) {
      temp = s2;
    }
  }
  cout << temp << endl;
  return 0;
}
