#include <bits/stdc++.h>
using namespace std;
int srm(int x1, int y1, int x2, int y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
int main() {
  char s[11];
  cin.getline(s, 11);
  char bigb = (char)((int)'a' - 1);
  int count;
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] == bigb) {
      count++;
      continue;
    }
    if ((int)s[i] > (int)bigb) {
      bigb = s[i];
      count = 1;
    }
  }
  for (int i = 0; i < count; i++) cout << bigb;
  return 0;
}
