#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (char ch : s) {
    mp[ch]++;
  }
  char ch;
  int cnt = 0;
  auto it = mp.begin();
  ch = char(it->first);
  cnt = int(it->second);
  ++it;
  for (; it != mp.end(); ++it) {
    if (ch < it->first) {
      ch = it->first;
      cnt = it->second;
    }
  }
  for (int i = 1; i <= cnt; i++) {
    cout << ch;
  }
  cout << endl;
  return 0;
}
