#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double eps = 1e-11;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const double pi = acos(-1.0);
const int MAX_INT = (1 << 30);
const ll MAX_LL = (1LL << 62);
class NumericalPerfectionLevel {
 private:
 public:
};
bool isPal(string s) {
  string rev = s;
  reverse((s).begin(), (s).end());
  return s == rev;
}
int main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  string res = "a";
  for (int msk = 0; msk < (1 << n); msk++) {
    string temp = "";
    for (int i = 0; i < n; i++) {
      if (msk & (1 << i)) {
        temp += s[i];
      }
    }
    if (isPal(temp) && temp > res) res = temp;
  }
  cout << res << endl;
  return 0;
}
