#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int i, j, k, n, max;
  while (cin >> str) {
    int x = str.size();
    sort(str.begin(), str.end());
    for (i = x - 1; i >= 0; i--) {
      if ((i != 0) and (str[i] == str[i - 1]))
        cout << str[i];
      else {
        cout << str[i];
        break;
      }
    }
    cout << endl;
  }
  return 0;
}
