#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, output, temp, temp1;
  cin >> s;
  int n = s.size(), m;
  m = pow(2, n);
  output = "";
  for (int i = 1; i < m; i++) {
    temp = "";
    temp1 = "";
    for (int j = 0; j < n; j++)
      if (i & (1 << j)) temp.push_back(s[j]);
    for (int j = temp.size() - 1; j >= 0; j--) temp1.push_back(temp[j]);
    if (temp == temp1 and temp > output) output = temp;
  }
  cout << output << endl;
}
