#include <bits/stdc++.h>
using namespace std;
char ch[15];
int main() {
  while (scanf("%s", ch) != EOF) {
    int len = strlen(ch);
    int m = 1 << len;
    string a, b;
    int tmp;
    a.clear();
    for (int i = 1; i < m; i++) {
      b.clear();
      for (int j = 0; j < len; j++) {
        tmp = i >> j;
        if (tmp & 1) {
          b += ch[j];
        }
      }
      int l = b.size();
      int p = 1;
      for (int s = 0, e = l - 1; s <= e; s++, e--) {
        if (b[s] != b[e]) {
          p = 0;
          break;
        }
      }
      if (p) {
        if (b > a) a = b;
      }
    }
    cout << a << endl;
  }
  return 0;
}
