#include <bits/stdc++.h>
using namespace std;
char z;
string x;
int i, j, y[1000], mas;
int main() {
  cin >> x;
  for (i = 0; i < x.length(); i++) {
    y[int(x[i])]++;
    if (int(x[i]) > mas) {
      z = x[i];
      mas = int(x[i]);
    }
  }
  for (j = 0; j < y[mas]; j++) {
    cout << z;
  }
}
