#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char a = s[0];
  int n = s.size();
  int c = 1;
  for (int i = 1; i < n; ++i) {
    if (s[i] > a) {
      a = s[i];
      c = 1;
    } else if (s[i] == a)
      ++c;
  }
  for (int i = 0; i < c; ++i) cout << a;
  return 0;
}
