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