#include <bits/stdc++.h>
using namespace std;
int main() {
  char text[11];
  char chr;
  int i, chrcount = 1;
  cin >> text;
  chr = text[0];
  for (i = 1; i < strlen(text); i++) {
    if (int(chr) < int(text[i])) {
      chr = text[i];
      chrcount = 1;
    } else if (int(chr) == int(text[i])) {
      chrcount++;
    }
  }
  for (i = 0; i < chrcount; i++) cout << chr;
  return 0;
}
