#include <bits/stdc++.h>
using namespace std;
class Task {
  string str;
  string answer = "";

 public:
  void getData() { cin >> str; }
  void solve() {
    char maxChar = str[0];
    for (int i = 0; i < str.size(); ++i) {
      maxChar = max(maxChar, str[i]);
    }
    for (int i = 0; i < str.size(); ++i) {
      if (str[i] == maxChar) {
        answer += str[i];
      }
    }
  }
  void printAnswer() { cout << answer; }
};
int main() {
  Task task = Task();
  task.getData();
  task.solve();
  task.printAnswer();
  return 0;
}
