#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  string string;
  cin >> string;
  std::sort(string.begin(), string.end());
  long a, i;
  a = string.size();
  ;
  for (i = string.size() - 1; i >= 0; i--) {
    if (string[a - 1] == string[i])
      cout << string[i];
    else
      break;
  }
  cout << endl;
}
