#include <bits/stdc++.h>
char c[11];
int main() {
  scanf("%s", c);
  char mx = 0;
  for (int i = 0; c[i]; ++i)
    if (mx < c[i]) mx = c[i];
  for (int i = 0; c[i]; ++i)
    if (c[i] == mx) putchar(c[i]);
  putchar('\n');
}
