#include <bits/stdc++.h>
using namespace std;
int main() {
  string input;
  cin >> input;
  int freq = 1;
  char curr;
  for (int i = 0; i < input.length(); i++) {
    if (input[i] > curr) {
      curr = input[i];
      freq = 1;
    } else if (input[i] == curr)
      freq++;
  }
  string ans;
  for (int i = 0; i < freq; i++) ans += curr;
  cout << ans << endl;
}
