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