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