#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  getline(cin, s);
  int size = s.length();
  char maxChar = 'a';
  for (int i = 0; i < size; ++i) {
    if (s[i] > maxChar) {
      maxChar = s[i];
    }
  }
  int count = 0;
  for (int i = 0; i < size; ++i) {
    if (s[i] == maxChar) {
      ++count;
    }
  }
  string ans = "";
  for (int i = 0; i < count; ++i) {
    ans += maxChar;
  }
  cout << ans << "\n";
}
