#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ss;
  long n, m;
  long p = 0, c = 0;
  cin >> s;
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == s[i + 1])
      ss += s[i];
    else
      break;
  }
  cout << s[0] << ss;
}
