#include <bits/stdc++.h>
using namespace std;
int main() {
  int cont = 0, ind = 0;
  char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                    's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
  string s;
  cin >> s;
  for (int i = 25; i >= 0; i--) {
    for (int j = 0; j < s.size(); j++)
      if (alpha[i] == s[j]) cont++;
    if (cont != 0) {
      ind = i;
      break;
    } else
      cont = 0;
  }
  for (int i = 0; i < cont; i++) cout << alpha[ind];
  return 0;
}
