#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count = 0;
  set<char> elements;
  for (int r = 0; r < s.length(); r++) {
    elements.insert(s.at(r));
  }
  set<char>::iterator it = elements.begin();
  advance(it, elements.size() - 1);
  for (int r = 0; r < s.length(); r++) {
    if (*it == s.at(r)) {
      count++;
    }
  }
  for (int r = 0; r < count; r++) {
    cout << *it;
  }
  return 0;
}
