#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long count = 0, i;
  char x = s[0];
  for (i = 0; i < s.length(); i++) {
    if (x < s[i]) {
      x = s[i];
      count = 1;
    } else {
      if (x == s[i]) count++;
    }
  }
  for (i = 0; i < count; i++) cout << x;
  return 0;
}
