#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  cin >> s1;
  int p = INT_MIN;
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] > p) {
      p = s1[i];
    }
  }
  for (int i = 0; i < s1.length(); i++) {
    if ((int)s1[i] == p) {
      cout << (char)p;
    }
  }
  return 0;
}
