#include <bits/stdc++.h>
using namespace std;
char word[11];
int main() {
  cin >> word;
  int size = strlen(word);
  sort(word, word + size);
  cout << word[size - 1];
  for (int i = size - 2; i >= 0; i--) {
    if (word[i] != word[size - 1]) break;
    cout << word[i];
  }
  cout << endl;
  return 0;
}
