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