#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int len = str.length();
  char mx = str[0];
  for (int i = 1; i < len; i++) {
    if (str[i] > mx) mx = str[i];
  }
  string res;
  for (int i = 0; i < len; i++) {
    if (str[i] == mx) res += str[i];
  }
  cout << res << endl;
}
