#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  map<char, int> m;
  for (int i = 0; i < (int)s.length(); ++i) m[s[i]]++;
  map<char, int>::iterator it = m.end();
  it--;
  for (int i = 0; i < it->second; ++i) {
    cout << it->first;
  }
  return 0;
}
