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