#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[11], c;
  int i;
  cin >> s;
  c = 'z';
  while (strchr(s, c) == 0) c--;
  for (i = 0; i < strlen(s); i++)
    if (s[i] == c) cout << c;
}
