#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[20];
  while (~scanf("%s", s)) {
    sort(s, s + strlen(s));
    printf("%c", s[strlen(s) - 1]);
    for (int i = strlen(s) - 1; i >= 0; i--)
      if (s[i] == s[i - 1])
        printf("%c", s[i]);
      else
        break;
    printf("\n");
  }
  return 0;
}
