#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ans;
  cin >> s;
  for (char itr : s)
    if (*max_element(s.begin(), s.end()) == itr) {
      ans += itr;
    }
  cout << ans;
}
