#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  int count = 0;
  cin >> s1;
  char c = s1[0];
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] == c)
      count++;
    else if (s1[i] > c) {
      count = 1;
      c = s1[i];
    }
  }
  cout << string(count, c);
  return 0;
}
