#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  short i;
  char max = NULL;
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] > max) max = s[i];
  }
  for (i = 0; i < s.size(); i++) {
    if (s[i] == max) cout << max;
  }
  cout << endl;
  return 0;
}
