#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  char current = s[0];
  int i = 0;
  while (current == s[i]) {
    cout << s[i];
    i++;
  }
  cout << "\n";
}
