#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end(), greater<char>());
  for (long long int i = 0; i < (long long int)s.length(); i++)
    if (s[i] == s[0]) cout << s[i];
}
