#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, cnt = 0;
  string s;
  cin >> s;
  char boro = s[0];
  for (i = 0; i < s.size(); i++) {
    if (boro < s[i]) boro = s[i];
  }
  for (i = 0; i < s.size(); i++) {
    if (boro == s[i]) cnt++;
  }
  for (i = 0; i < cnt; i++) cout << boro;
  cout << endl;
  return 0;
}
