#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  sort(str.begin(), str.end());
  char a = str[str.size() - 1];
  for (int i = str.size() - 1; str[i--] == a;) cout << a;
}
