#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int m = 0;
  for (int i = 0; i < s.size(); i++) {
    m = max(s[i] - 'a', m);
  }
  char c = char('a' + m);
  int k = count(s.begin(), s.end(), c);
  for (int i = 0; i < k; i++) cout << c;
}
