#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, p;
  cin >> s;
  long long int l = 1;
  sort(s.begin(), s.end(), greater<char>());
  for (long long int i = 1; i < s.size(); i++) {
    if (s[i] == s[0]) l++;
  }
  while (l--) p += s[0];
  cout << p << endl;
}
