#include <bits/stdc++.h>
using namespace std;
bool checkpalin(string h) {
  int g = h.length();
  int j = g - 1;
  for (int i = 0; i < g / 2; i++) {
    if (h[i] == h[j]) {
      j--;
      continue;
    } else {
      return 0;
    }
  }
  return 1;
}
int main() {
  long long int i, j, k, m, n;
  string s;
  string dp[100000];
  cin >> s;
  int d = s.length();
  int p = 1 << d;
  set<string> s1;
  for (i = 1; i <= p; i++) {
    string f = "";
    for (j = 0; j < d; j++) {
      if (i & (1 << j)) {
        f = f + s[j];
      }
    }
    if (checkpalin(f)) {
      s1.insert(f);
    }
  }
  int w = 0;
  while (!s1.empty()) {
    dp[w] = *s1.begin();
    s1.erase(s1.begin());
    w++;
  }
  cout << dp[w - 1];
  return 0;
}
