#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  vector<string> vc;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    s1 = s[i];
    vc.push_back(s1);
    for (int j = i + 1; j < s.size(); j++) {
      s1 = s[i];
      s1 += s[j];
      vc.push_back(s1);
      for (int l = j + 1; l < s.size(); l++) {
        s1 = s[i];
        s1 += s[j];
        s1 += s[l];
        vc.push_back(s1);
        for (int k = l + 1; k < s.size(); k++) {
          s1 = s[i];
          s1 += s[j];
          s1 += s[l];
          s1 += s[k];
          vc.push_back(s1);
          for (int a = k + 1; a < s.size(); a++) {
            s1 = s[i];
            s1 += s[j];
            s1 += s[l];
            s1 += s[k];
            s1 += s[a];
            vc.push_back(s1);
            for (int b = a + 1; b < s.size(); b++) {
              s1 = s[i];
              s1 += s[j];
              s1 += s[l];
              s1 += s[k];
              s1 += s[a];
              s1 += s[b];
              vc.push_back(s1);
              for (int c = b + 1; c < s.size(); c++) {
                s1 = s[i];
                s1 += s[j];
                s1 += s[l];
                s1 += s[k];
                s1 += s[a];
                s1 += s[b];
                s1 += s[c];
                vc.push_back(s1);
                for (int d = c + 1; d < s.size(); d++) {
                  s1 = s[i];
                  s1 += s[j];
                  s1 += s[l];
                  s1 += s[k];
                  s1 += s[a];
                  s1 += s[b];
                  s1 += s[c];
                  s1 += s[d];
                  vc.push_back(s1);
                  for (int e = d + 1; e < s.size(); e++) {
                    s1 = s[i];
                    s1 += s[j];
                    s1 += s[l];
                    s1 += s[k];
                    s1 += s[a];
                    s1 += s[b];
                    s1 += s[c];
                    s1 += s[d];
                    s1 += s[e];
                    vc.push_back(s1);
                    for (int f = e + 1; f < s.size(); f++) {
                      s1 = s[i];
                      s1 += s[j];
                      s1 += s[l];
                      s1 += s[k];
                      s1 += s[a];
                      s1 += s[b];
                      s1 += s[c];
                      s1 += s[d];
                      s1 += s[e];
                      s1 += s[f];
                      vc.push_back(s1);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  long long i;
  s1 = s[0];
  string ans = s1;
  for (i = 0; i < vc.size(); i++) {
    string p = vc[i];
    reverse(p.begin(), p.end());
    if (vc[i] == p) {
      ans = max(ans, p);
    }
  }
  cout << ans;
}
