#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  char most = 'a' - 1;
  int count = 0;
  for (auto c : s)
    if (c > most) {
      most = c;
      count = 1;
    } else if (c == most)
      ++count;
  while (count--) cout << most;
  return 0;
}
