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